Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I know SharePoint has some hidden fields for list items. I need to check the timestamp for when a list element was created, is this possible?

The reason is I must allow the item to be edited for the first 10 minutes after creation, but not after that (through an item receiver).

Thanks in advance

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

The other answers work, but you may want to consider:

item[SPBuiltInFieldId.Created];

I'm never sure what happens to the default field names in non-English language setups.

share|improve this answer
1  
The CSOM ListItem object doesn't support Guid indexor. Must use the ["Created"] instead. –  Philippe Lavoie Nov 19 '13 at 15:28
add comment

Each item has a created date and modified date which you can get through the indexer.

item["Created"];
share|improve this answer
add comment

The item["Created"] field will store the date and time that item was created. Cast it to a DateTime type to do your comparison.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.