Re: datetime conversions - US CST

From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 08/26/04


Date: Wed, 25 Aug 2004 21:44:43 -0500

Mark,
In case you missed my point. I am suggesting you only send time in universal
time between servers. I would convert local time to universal time on the
originating systems only (not pass thru systems).

No matter what server you are on, or how many you pass thru, the time will
still be universal time. Hence there is no worry as to what the local time
is!

To answer your question, DateTime does not itself keep track as to whether
it is in Local or Universal time you need to do this yourself. I normally do
this via the context of the variable.

You can use System.TimeZone.CurrentTimeZone to find out what the current
time zone on your system is.

Hope this helps
Jay

"Mark" <marfi95@yahoo.com> wrote in message
news:f47c17d0.0408250550.1aacb8f2@posting.google.com...
> Thanks Jay.
>
> Unfortunately, in this environment, the server that I referred to is
> not the end location and is not in CST. For this particular txn, its
> just passing thru the message on to the final dest. So the server
> would have the same problem. I haven't looked yet, but does the
> localtime include the timezone locally also, so I would have that
> information ?
>
> "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com> wrote in message
news:<uGllUVliEHA.3536@TK2MSFTNGP12.phx.gbl>...
> > Mark,
> > Unfortunately System.DateTime (VB's Date) only knows how to convert a
> > Universal Time to Local Time & convert Local Time to UniversalTime.
> >
> > I would recommend that each of your machines convert local time to
universal
> > time, then send that time to the server. The server can then convert the
> > universal time to local time which will be CST.
> >
> > You can use
> > - DateTime.Now - to get current local date & time
> > - DateTime.UtcNow - to get current date & time in universal time (UTC)
> > - DateTime.ToUniversalTime - to convert local time to universal time
> > - DateTime.ToLocalTime - to convert universal time to local time
> >
> >
> > Hope this helps
> > Jay
> >
> > "Mark" <marfi95@yahoo.com> wrote in message
> > news:f47c17d0.0408241507.65f44958@posting.google.com...
> > > Hey everybody.
> > >
> > > Is there an easy way in vb.net to convert the local time of a machine
> > > to US CST ? My machines are distributed throughout and the server is
> > > requesting we send the time of the txns in US CST.
> > >
> > > TIA,
> > > Mark



Relevant Pages

  • Re: datetime conversions - US CST
    ... Unfortunately, in this environment, the server that I referred to is ... > Universal Time to Local Time & convert Local Time to UniversalTime. ... > universal time to local time which will be CST. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Paris: hottest day of the year
    ... +0200 is the offset of your local time from GMT/Universal Time in hhmm ... Though "-0000" also indicates Universal Time, ... Server and select a server ... "Passa automaticamente all'ora legale" is now checked. ...
    (rec.travel.europe)
  • Re: datetime conversions - US CST
    ... Universal Time to Local Time & convert Local Time to UniversalTime. ... then send that time to the server. ... > requesting we send the time of the txns in US CST. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: deleting cookies and local browser time versus server time
    ... Is there a way to get the local time from the user's browser? ... Well, considering you're asking the $_SERVER for a local user variable, ... set the cookie back appropriately. ...
    (comp.lang.php)
  • Re: Day Light Savings time changes on March 11
    ... An ISP starts out with one mail server and a management server, they create tools that automate and report on the system. ... It is all in local time. ... We will convert them, but it takes and plan, and a reason. ... logo change for Memorial Day. ...
    (freebsd-questions)