Created Date in SPListItemVersion does not respect locale settings?

June 2, 2009

A Quick post! On a recent project we had a custom control that was showing document version history information such as “Created By” and “Date Created” in a table format, it was looking all good. After the day light savings time (British Summer Time) one of the tester spotted a bug in document version history control where “Date Created” was still showing the GMT time, it looked like SPListItemVersion.Created was not respecting day light savings time.

TimeZone.xml looked good and every other Dates on the site were showing correct time. It turns out that SPListItemVersion.Created was only showing time in GMT (Don’t know why!) so a simple fix was to convert the time into local time at the render time.


lblDateCreated.Text = version.Created.ToLocalTime().ToString();

Entry Filed under: MOSS. Tags: .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Tags

Add new tag Commerce Server JavaScript jQuery MOSS MOSS Search WebParts Workflow WPF/E

KWitty

Blogroll

Feeds

Add to Technorati Favorites

del.icio.us

Categories