Re: How do I convert a DateTime to another time zone?
From: Drebin (thedrebinNoSpam_at_hotmail.com)
Date: 03/26/04
- Next message: James P: "Re: How do I write an uninstall program in .NET?"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: How do I convert a DateTime to another time zone?"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: How do I convert a DateTime to another time zone?"
- Next in thread: Larry FAA: "Re: How do I convert a DateTime to another time zone?"
- Messages sorted by: [ date ] [ thread ]
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?
>
>
- Next message: James P: "Re: How do I write an uninstall program in .NET?"
- Previous message: Nicholas Paldino [.NET/C# MVP]: "Re: How do I convert a DateTime to another time zone?"
- In reply to: Nicholas Paldino [.NET/C# MVP]: "Re: How do I convert a DateTime to another time zone?"
- Next in thread: Larry FAA: "Re: How do I convert a DateTime to another time zone?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|