US Time Zones Question

B

Burak

Hello,

I am working on an election site. The users are going
to enter the start and end times as well as the US
time zone (EST/CST/etc..) for an election. Then we are
supposed to display the ballot and result pages
depending on if the election is going on or has ended.

I have couple of quick questions:

1) How can we determine the timezone of the web
server?

2) Is there a function that converts one time zone to
another or do we do it manually by adding/subtracting
hours?

Thank you,

Burak
 
J

Jay B. Harlow [MVP - Outlook]

Burak,
1) How can we determine the timezone of the web
server?
You can use System.TimeZone.CurrentTimeZone to get the current time zone.
2) Is there a function that converts one time zone to
another or do we do it manually by adding/subtracting
hours?
The System.TimeZone object has methods to convert ToLocalTime &
ToUniveralTime, however I don't know of any method to get a specific
TimeZone (such as EST or PST).

The following article offers a number of guide lines in dealing with
DateTime values in .NET:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/datetimecode.asp

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top