🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5741

Datetime conversion between timezones

#5741
From: Dennis Jones
Date: Fri, 08 Jul 2005 18:29
27 lines
1958 bytes
Hi,

I need to convert a date/time in a given timezone to a date/time in another
timezone.  While GetTimeZoneInformation() and
SystemTimeToTzSpecificLocalTime() might be useful functions, they are a far
cry from what is necessary to accomplish the task.

First, SystemTimeToTzSpecificLocalTime is a one way function
(UTC->localtime).  An inverse function is necessary to go from
localtime->UTC.  Though XP has such a function
(TzSpecificLocalTimeToSystemTime), it only exists on XP.  It is not
available on Win2K or NT.

Second, SystemTimeToTzSpecificLocalTime and TzSpecificLocalTimeToSystemTime
both require information about the target/source timezone.
GetTimeZoneInformation returns information about the system's current
timezone, but that's only useful if the system's current timezone happens to
be the source or the target timezone.

So, I have two questions:

1) How does one get timezone information about OTHER timezones?
2) Assuming it is possible to get the source/target timezone information,
what do you do when you are running on an OS that doesn't have
TzSpecificLocalTimeToSystemTime?

- Dennis
Technical Details
Message-ID: <42cec603$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,424ca78a9d71afb,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Dennis Jones" <nospam@nospam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Datetime conversion between timezones
Date: Fri, 8 Jul 2005 11:29:19 -0700
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 204.200.27.7
Message-ID: <42cec603$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1120847363 204.200.27.7 (8 Jul 2005 11:29:23 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail