AI OnAI Off
Hi,
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.
Regards.
/Q
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 -http://world.episerver.com/Forum/Developer-forum/EPiServer-Commerce/Thread-Container/2012/5/Setting-Up-Commerec-site-in-different-timezones/