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

In SharePoint 2007 List, there is a field (or column) called "Created". It contain the date in which a item is created.

I want to create any field, a calculated field, to help me calculate the milliseconds of the date in the "Created" field.

Any Ideas?

Additional Information

For example: 10/10/2010 10:11:12:80 will return the value 80 as the millisecond. If I =MINUTE[Created], it will return the value 11 as the minute. (In this case, I am looking for the millisecond.)

share|improve this question
    
I would love to know what you're doing with SP that you need to know the created time down to milliseconds - care to share? –  Ryan Nov 9 '11 at 19:34
1  
@Ryan, The reason for the need to know the milliseconds is because if there are many new item insert into a list at the same time, I need to create a special & unique serial number based on the time it is created. If at 10:11:12 there are 5 new items, I can't have the 5 of them to have serial number that contain 101112. Therefore, there is a need to know up to the milliseconds. Do let me know how would you retrieve the milliseconds[Created]. –  Anderson Karu Nov 10 '11 at 9:05
    
Gotcha - you could use the ID column or an event receiver to create your own unique ID though. Also - if you are expecting that sort of volume of data entry then you may be stretching SharePoints capabilities a bit, probably best to check out technet.microsoft.com/en-us/library/cc262787.aspx –  Ryan Nov 10 '11 at 11:40
add comment

2 Answers 2

SharePoint expresses dates in days.

Multiply by 24 to express it in hours, then by 3600 to express it in seconds, then by 1000 to express it in milliseconds:

[Created]*24*3600*1000

If you only want to eep the milliseconds, try this:

([Created]*24*3600-INT([Created]*24*3600))*1000

share|improve this answer
1  
There is no MILLISECOND, but my second formula should do the job. –  Christophe Nov 9 '11 at 15:34
1  
Hi Christophe, from my understanding, the [Created] only contain MM/DD/YYYY HH:MM AM/PM. If that is the case, there is surely no way to eep the milliseconds since there is no milliseconds inside the [Created]. Your method is basically converting the time to milliseconds using the [Created] field. Do correct me if I have mis-understand that [Created] does not contain milliseconds. –  Anderson Karu Nov 18 '11 at 7:42
1  
Thanks Christophe for mentioning that SharePoint store the date and time as a number. Originally, I thought that SharePoint only store MM/DD/YYYY HH:MM AM/PM only. However the 2nd formula keep returning 0.0 (if the calculated field is 'Number' type) or 0 (if the calculated field is 'String' type). Any insight? –  Anderson Karu Nov 21 '11 at 1:07
1  
I did a couple tests, and it seems that you cannot go under the second. I used more precise formulas, but they always return 0.01 or 999.98 ms, which is certainly a rounding issue. –  Christophe Nov 21 '11 at 20:41
1  
Well, this is my conclusion. Time is stored as a decimal number, but apparently not with enough precision to give you milliseconds. –  Christophe Nov 22 '11 at 4:25
show 4 more comments
up vote 1 down vote accepted

To conclude this question: There is no way to retrieve the millisecond from SharePoint 2007 as discussed with Christophe.

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.