Bad design is the father of invention

Rupendra Dhillon's ASP .Net weblog

Convert time from one timezone to another in .Net

The sample below shows how to convert time from one time zone (say local) to another time zone (say Arizona time)

DateTime dlocal

= DateTime.Now;

DateTime dNonLocal

= TimeZoneInfo.ConvertTime(

dlocal,

TimeZoneInfo.FindSystemTimeZoneById("US Mountain Standard Time"));

Another real-good article on TimeZoneInfo class can be found here.

Digg This

Comments

Nikeeta vanja said:

it is in Asp.net 3.5 is it possible 2.0 ???? in 2.0 not getting object of TimeZoneInfo, can any body help ?????

# May 12, 2010 8:21 AM

Neha said:

A real good post!

Thanks

# July 12, 2010 7:25 AM

Whitny Meetington said:

It is extremely interesting for me to read the blog. Thank author for it. I like such topics and everything connected to them. I would like to read a bit more on that blog soon.    

Whitny  Meetington  

<a href="indianescortmodels.com/">indian massage london</a>

# February 18, 2011 8:38 AM

Brandy Flouee said:

It is extremely interesting for me to read the post. Thanks for it. I like such topics and everything connected to them. I definitely want to read more soon.    

Brandy  Flouee    

<a href="www.latinescortlondon.com/">brazilian escorts London</a>

# February 26, 2011 4:46 PM

Katty Karver said:

It was rather interesting for me to read that blog. Thanx for it. I like such themes and everything that is connected to this matter. I would like to read a bit more on that blog soon.      

Katty  Karver    

<a href="www.jammer-store.com/">cell phone signal scrambler</a>

# March 4, 2011 9:36 PM

Whitny Smith said:

It was extremely interesting for me to read the blog. Thanx for it. I like such topics and everything that is connected to this matter. I definitely want to read a bit more on this blog soon.        

Whitny  Smith        

<a href="www.phone-blocker.com/">cellular phone jammers</a>

# March 24, 2011 5:42 PM

Nicky Stepman said:

It was extremely interesting for me to read that post. Thanks for it. I like such themes and everything connected to them. I would like to read more on this blog soon.          

Nicky  Stepman          

<a href="milanescorts.com/">accompagnatrici escort in milano</a>

# April 7, 2011 11:48 AM

Omkar R said:

TimeZoneInfo is available in only .Net 3.5 and above. What about if someone try to implement the same in .Net 2.0. Is there any workaround? If possible then please mention that also.

Thanks,

Omkar R

# December 19, 2011 10:49 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)