views:

48

answers:

1

I am currently handling concurrency on my page using a DateTime field. The data is passed through ASP.NET using an XML which comes with Timezone.

So to adjust timezone I am adding 4 hrs to time received (EST) in my procedure and then comparing.

Now it was all working fine till Nov 1st. Now the time I am receiving is 5 hrs behind the time in SQL Server and comparison is failing.

I need to know how to handle such situation? Is there any better way of doing this?

I hope I am clear with the question. Let me know if any more info is needed.

+1  A: 

Check out the TimeZoneInfo class. It lets you convert between time zones, and determine the local timezone using the TimeZoneInfo.Local property.

Don Kirkby
Does it handles DayLight saving also?
noob.spt
I think daylight saving is a separate time zone from standard, and there's a method that lists all the time zones your system knows about. You'll probably find EST and EDT as two of the time zones in the list. TimeZoneInfo.Local should just return whichever one your system is currently set to. If you want a specific time zone, there's probably another method that will look it up based on the code.
Don Kirkby