Wrong time displayed in forum
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).
Anyone?
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") %>
That worked. Thanks Arno!
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.