Re: How do I convert a DateTime to another time zone?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Drebin (thedrebinNoSpam_at_hotmail.com)
Date: 03/26/04


Date: Fri, 26 Mar 2004 17:27:41 GMT


And it gets worse from there, not every country celebrates Daylight Savings
on the same day as the US.. PLUS - some don't participate at all. So keeping
a database of start and end times would be a mess.. because also consider
many countries have multiple time zones - so you'd almost need to know the
postal code of where you are, to geomap which zone you are in..

Depending on your app, it's best to store everything in UTC/GMT/Zulu 0:00
time.. for DISPLAY purposes, you could just have the user choose what thier
offset is? Or.. if it's on the local machines (which is ideal) - you can
just do .ToLocalTime() to the UTC and it handles it automatically..

HTH

"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
message news:eIZePY1EEHA.4084@TK2MSFTNGP11.phx.gbl...
> Larry,
>
> You are going to have to do this yourself. Unfortunately, you can
only
> get the TimeZone instance that corresponds to the current system time
zone,
> not any others (which is foolish in my opinion). You will have to keep a
> table of timezones as well as the offsets, and then adjust your date time
> instance accordingly.
>
> Hopet this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@spam.guard.caspershouse.com
>
> "Larry FAA" <anonymous@discussions.microsoft.com> wrote in message
> news:F67E6EC1-DC35-4C73-84B5-F4C4372453A3@microsoft.com...
> > I would like to know the date and time in another time zone, but I
cannot
> figure out how to do it. For example, I have a DateTime in UTC that is
> 23:00, which is 18:00 EDT. I would like to know the time in the PDT
> timezone. Does anyone know which class I should use to do the conversion?
>
>



Relevant Pages

  • Re: How do I convert a DateTime to another time zone?
    ... And it gets worse from there, not every country celebrates Daylight Savings ... many countries have multiple time zones - so you'd almost need to know the ... > get the TimeZone instance that corresponds to the current system time ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How do I convert a DateTime to another time zone?
    ... And it gets worse from there, not every country celebrates Daylight Savings ... many countries have multiple time zones - so you'd almost need to know the ... > get the TimeZone instance that corresponds to the current system time ...
    (microsoft.public.dotnet.framework)
  • Re: How do I convert a DateTime to another time zone?
    ... And it gets worse from there, not every country celebrates Daylight Savings ... many countries have multiple time zones - so you'd almost need to know the ... > get the TimeZone instance that corresponds to the current system time ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is it acceptable to post a URL to request review of Userability?
    ... Because there're insane countries using DST, people will change the time between UTC+2 and UTC+1. ... It would be better to show the timezone for every date or indicate "All times are UTC+NN" near the table. ... The difference is at most 0.9 seconds, but with the UTC time, every second has the same duration at the cost of introducing leap seconds. ... The time would automatically be adjusted by your system with the local country rules. ...
    (comp.infosystems.www.authoring.html)
  • Re: American date order
    ... The letter suffixes indicate time zones; the same system is still in use ... Now, as regards Allied forces in the ETO, there is a trivia point here ... that can be critical to reading WWII docs -- understanding the timezone ... exact same incident at the exact same time can give a time up to three ...
    (soc.history.war.world-war-ii)