View Full Version : time diffrense
mikecotic
03-23-2008, 09:04 AM
what is the least time consuming way to enable correct timing in my whole web application - i am talking about the time zone changes : in isreal the time zone is gmt +2 ,where as, on the server its different . my application uses the datetime.now method in many palaces - what is the easiest way to compensate the datetime difference , is there any simple web.config file change or something like that . the culture for example is easy to change :
[quote]<globalizationculture='he-IL'uiCulture='he-IL'/></CODE>
thanks in advance ..
wisemx
03-23-2008, 10:42 AM
Hi,
Take a look at this:
http://www.codeproject.com/KB/aspnet/Remote_Time_Zone.aspx
Salute,
Mark
mikecotic
03-24-2008, 09:02 AM
thx , but that method seems to be messy , i found no simple soultion but to replace all my datetime.now s in the application to a method of a class i constructed . thta class uses the uts method of datetime object and adds to it 2 hours
Aristotle
03-24-2008, 09:24 AM
Yeah, time zone conversion can be a pain. Your solution works if all your users are in Israel or in the same timezone. But I think wisemx's solution is for a scenario where your users can be anywhere in the world.
If your application requires your users to login via form authentication, you can ask your user to select their timezone and display/record the time accordingly based on that.
Aristotle
DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)
vBulletin® ©Jelsoft Enterprises Ltd.