Yes they will. Let's say you need to convert the current time.
DateTime currentTime = DateTime.Now;
DateTime utcTime = currentTime.ToUniveralTime();
or the short version: DateTime utcTime = DateTime.Now.ToUniversalTime();
If you need to use a date other than "now":
DateTime myDate = DateTime.Parse("7/4/2004 13:00:00");
DateTime utcTime = myDate.ToUniversalTime();
the short version: DateTime utcTime = DateTime.Parse("7/4/2004
13:00:00").ToUniversalTime();
To convert back:
DateTime myDate = utcTime.ToLocalTime();
Of course, this example assumes you are using the timezone of the machine
the application lives on. If you're on the east cost and need to convert to
pacific, you can use the Calendar Object to set the locale and pull your
dates/times from that. Though, if you need that flexability, and are going
to bu reusing that code, I would take the custom utility class approach.
"Bijoy Naick" <b_*****@yahoo.ca> wrote in message
news:uV**************@TK2MSFTNGP11.phx.gbl...
these functions wont allow me to convert a time in Pacific time to UTC..
will they?
"Jason Penniman" <jp*******@actcci.com> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl... Microsoft recommends using UTC time (universal Time Coordinate)...similar
to the GMT concept. If you use that...
DateTime.ToLocalTime()
DateTime.ToUniversalTime()
If you want GMT, you'll have to write your own utility class.
-Jason
"Bijoy Naick" <b_*****@yahoo.ca> wrote in message
news:eq**************@TK2MSFTNGP09.phx.gbl... >I have an events table which stores the time of each event - the time
>and
> assoicated timezone. Is there a way of converting this time into GMT (with > support for DST).. some sort of function which accepts a time and timezone > as parameters and returns the time in GMT?
>
>