Wrong time displayed in forum

Posted by Community Admin on 03-Aug-2018 17:34

Wrong time displayed in forum

All Replies

Posted by Community Admin on 07-Mar-2013 00:00

I'm displaying the time of the post on the "List of Posts" template in the forum using the following:

<%# ((DateTime)Eval("LastPostDate")).ToString("h:mm tt") %>

It's returning the wrong time... +6 hours. How can I fix this? The time zone is set correctly in the settings to (UTC-06:00) Central Time (US & Canada).

Posted by Community Admin on 10-Mar-2013 00:00

Anyone?

Posted by Community Admin on 10-Mar-2013 00:00

Hi Jeff,

Sitefinity stores the date in UTC. It think it's a bug if the forum template is displaying the date the way you posted it here, as it is just ignoring the time zone you have set. Can you try the code below?

<%# Telerik.Sitefinity.SystemExtensions.ToSitefinityUITime(((DateTime)Eval("LastPostDate"))).ToString("h:mm tt") %>

Posted by Community Admin on 11-Mar-2013 00:00

That worked. Thanks Arno!

Posted by Community Admin on 14-Feb-2014 00:00

I have faced the same issue. But your solution didn't work for me. If I set time to 12am, database time sets  6pm . And after binding items as you suggested it anyway shows 6pm . Timezone settings are  UTC-6. 

This thread is closed