Re: datetime conversions - US CST

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


Date: Tue, 24 Aug 2004 22:40:43 -0500

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
    ... I would convert local time to universal time on the ... No matter what server you are on, or how many you pass thru, the time will ... >> 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
    ... 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: time functions
    ... "Tyagi" wrote: ... > how to convert a local time to universal time. ... CTime::GetGmtTm, this fucntion may help ...
    (microsoft.public.vc.mfc)
  • Re: getutcdate() issues
    ... If your server has incorrect local time, ... I still fail to understand why this is the database engine's fault. ... them with the correct system clock. ...
    (microsoft.public.sqlserver.programming)

Quantcast