Time Zone Localization

mojoPortal intends to store all datetime in the database as UTC and to provide timezone adjustment when displaying datetime according to the user's time zone offset as specified on the My Profile page.

For unauthenticated users, time is displayed using the PreferredGreenwichMeantimeOffset setting from the Web.config file.

If the server time is accurate these features work fairly well. In the Administration Menu > System Information screen, you can see what time the server thinks it is and what timezone it thinks it is in as well as what the PreferredGreenwichMeantimeOffset setting is.

The current implementation is limited in that it does not acocunt for users who's local is in a different time zone or has a different offset during different times of the year. So currently its up to the user to keep this offset correct on the user profile in order to see correctly localized time when logged into the site.

For timestamps generated automatically by the system we use DateTime.UtcNow.

For things that use the datepicker to set datetime we adjust from the user's timezone offset to calculate UTC for the selected datetime.

If the database is on a different server than the web server and the time is not in sync with the web server things can get out of sync and content can be filtered incorrectly.

You should make sure your profile has the correct timezone offset if you are a content editor or administrator.

For anonymous users, the timezone offset default preference can be set in Web.config

<add key="PreferredGreenwichMeantimeOffset" value="-4.00" />

 


Donate Money to support the mojoPortal Project.
Join the mojoPortal Group on Facebook
Join the mojoPortal Group on LinkedIn
View Joe Audette's profile on LinkedIn
View Joe Audette's profile on The Guild of Accessible Web Designers site
mojoPortal can run on GNU/Linux using Mono

ASP.NET Web Applications, Controls, Resources, Reviews
WorldOfASP.NET
view our resources 123aspx.com Directory
411ASP.NET
mojoPortal Wins the 2007 Open Source CMS Awards Best Non-PHP Open Source CMS
Share This Using Popular Bookmarking Services