Home

Wednesday, June 25, 2014

DAX- UTC date time, different time zone show differerent time on form and code(classes)

UTC date time field always store values as GMT or UTC on database
While displaying on forms it convert and display it automatically by user preferred time zone.
But when you access it through code in Classes , you will get the UTC date time (without time zone difference). So you need to convert it first before using for any calculation and comparison.
static void Job22(Args _args)

 {

                utcDateTime utc3 = str2datetime( “1985/07/27 23:04:59″ ,321 );

                 info(strFmt(‘%1′ ,DateTimeUtil::applyTimeZoneOffset( utc3, DateTimeUtil::getUserPreferredTimeZone())));

 }
For more information please visit following link
http://msdn.microsoft.com/en-us/library/cc584924.aspx

No comments:

Post a Comment