In SharePoint 2007, when I saved a document to a document library, the value shown in the list view under Modified is:
18/6/2012 13:06
But yet when I programmatically access the field which I assume is SPListItem.File.TimeLastModified, it returned:
18/6/2012 3:06:43 AM
That means the 1 has been truncated, and so whatever that is reading the value turned 1pm into 3am.
The site and the webs are all inheriting the correct time zone. What should I do to make TimeLastModified to display the correct time? Or is this possible at all?
Thanks.
The
TimeLastModifiedproperty returns the value always in UTC. Date/time values displayed on SP pages are usually converted to the time zone according to the culture of the current user. It is a good practice to show everything in the user’s time zone but internally save the value in UTC.If you want to convert the UTC value to the current user’s time zone and then maybe print it in UI, you can use the following code:
— Ferda