Commerce DB TimeStamp is UTC. WEbsite shows incorrect date and time.


Episerver saves all datetimes in UTC in database. And then they show all timestamp on website in local timestamp. All our classes use Mediachase.Web.Console.Common.ManagementHelper. And this class is suppose to implement GetUserDateTime method to convert it to local time stamp. But unfortunately episerver has not implemented this method. Hence we see the UTC times which is not correct.

              /// Returns datetime value converted based on current user's settings.
              /// DateTime in UTC.
              public static DateTime GetUserDateTime(DateTime dt)
                     // TODO: need to store time zone settings for each user and display datetime based on these settings.
                     return dt.ToLocalTime();

Article reference is  -

Mar 26, 2015 17:39


I'm not sure what you meant "has not implemented this method". This method converts UTC time to local time and it works this way. What hadn't been implemented (the TODO) was the timezone setting per user (which was abandoned future). 

In Commerce 7.5 the method was obsoleted and we recommend to use ToLocalTime directly.



Mar 27, 2015 11:54
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.