EDN Admin
Well-known member
Im using ms:format-date as follows:
<xsl:value-of select="ms:format-date(ItemDate, MM/dd/yyyy)"/>
The date coming from the database looks like this:
2011-02-15 20:00:00.000
The result of the transform is :
02/16/2011
My guess is that it has something to do with timezones. Im in GMT -5 and the time portion of that datetime would be 8:00 PM, however, I dont understand why it wouldnt just display the date portion as requeted. To work around the issue,
I have my SQL query returning a varchar(10) of the date, which it returns "02/15/2011" as expected. Unfortunately, Im using this transform in quite a few system generated emails and will have to modify quite a few stored procedures to return a formatted
date
Unless someone here has an idea on how I can fix it (without resorting to writing my own extension). It just pains me that such a basic concept as formatting a date is problematic. Ugh.
Thanks for any insight and advice.
Jerry
View the full article
<xsl:value-of select="ms:format-date(ItemDate, MM/dd/yyyy)"/>
The date coming from the database looks like this:
2011-02-15 20:00:00.000
The result of the transform is :
02/16/2011
My guess is that it has something to do with timezones. Im in GMT -5 and the time portion of that datetime would be 8:00 PM, however, I dont understand why it wouldnt just display the date portion as requeted. To work around the issue,
I have my SQL query returning a varchar(10) of the date, which it returns "02/15/2011" as expected. Unfortunately, Im using this transform in quite a few system generated emails and will have to modify quite a few stored procedures to return a formatted
date
Unless someone here has an idea on how I can fix it (without resorting to writing my own extension). It just pains me that such a basic concept as formatting a date is problematic. Ugh.
Thanks for any insight and advice.
Jerry
View the full article