Time Zones 
Author Message
 Time Zones

Is there anyway to get a System.TimeZone given the name of the time zone?
There's no constructor or static method on TimeZone that does this.


Tue, 10 May 2005 09:30:54 GMT  
 Time Zones


Quote:
> Is there anyway to get a System.TimeZone given the name of the time zone?
> There's no constructor or static method on TimeZone that does this.

No. The TimeZone implementation in .NET is very lacking.

-c



Tue, 10 May 2005 11:30:20 GMT  
 Time Zones
Windows and .NET only support one current, systemwide timezone.

Informations for other time zones are saved in the registry:
  http://groups.google.com/groups?selm=%23Vef0WmJCHA.1924%40tkmsftngp09

--
 Thomas Scheidegger - MVP .NET - 'NETMaster'
 http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/

Quote:

> Is there anyway to get a System.TimeZone given the name of the time zone?
> There's no constructor or static method on TimeZone that does this.



Tue, 10 May 2005 18:43:43 GMT  
 Time Zones



Quote:
> > Is there anyway to get a System.TimeZone given the name of the time
zone?
> > There's no constructor or static method on TimeZone that does this.

> Windows and .NET only support one current, systemwide timezone.

Then it's a good thing .NET is an OS-independent framework and there's no
reason it should be restricted to exposing Windows functionality.  Being
able to parse a time like

    12:35 PDT

and convert it either to the current time zone or to UTC is extremely
useful.  Java can do this, and J# is documented as being able to
(java.util.TimeZone.getTimeZone for both).  Hopefully support will be added
to .NET proper before long.

Quote:

> Informations for other time zones are saved in the registry:
>   http://groups.google.com/groups?selm=%23Vef0WmJCHA.1924%40tkmsftngp09

Thanks for the link.


Wed, 11 May 2005 05:05:50 GMT  
 Time Zones
It's not so difficult to implement a time zone. Basically you have to
inhirit from TimeZone which is abstract and provides nearly all needed
(protected) methods for calculation.
If you want an example, check the rotor library, the currentTimezone class
does this.
As source of timezone information you can use the info of the registry (the
tzi struct)



Quote:
> Windows and .NET only support one current, systemwide timezone.

> Informations for other time zones are saved in the registry:
>   http://groups.google.com/groups?selm=%23Vef0WmJCHA.1924%40tkmsftngp09

> --
>  Thomas Scheidegger - MVP .NET - 'NETMaster'
>  http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/




Quote:
> > Is there anyway to get a System.TimeZone given the name of the time
zone?
> > There's no constructor or static method on TimeZone that does this.



Fri, 13 May 2005 00:25:19 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to convert local time with specific time zone to UTC time in Win32 API

2. Real time From Time Zone information

3. set date/time/time zone dialog

4. How to convert local time to gmt using a local variable time zone per process/thread

5. Obtain Time Zone

6. Getting time zone information?

7. localtime() / time zone question

8. Need time zone conversion routine/program/function that is callable, pcumming

9. Dataset DateTime column value affected by time zone setting

10. How to maintain TimeStamp consistency across Time Zones?

11. Time zone

12. Help:Time zone references

 

 
Powered by phpBB® Forum Software