🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Timezone problems

#47
From: Michael Thomsen
Date: Thu, 07 Aug 2008 09:42
20 lines
1601 bytes
Hello,

I would like to convert the current PC time into UTC. According to my
documentation the function GetTimeZoneInformation() should do what I
need, but either it doesn't work, or I do not understand how it works:

   TTimeZoneInformation TimeZone;
   GetTimeZoneInformation(&TimeZone);
   TransmitPCtime(Now()+(double)(TimeZone.Bias+TimeZone.DaylightBias)/(60*24));

The above code works for most timezones, both with standard and daylight
saving time. However for certain timezones and standard/daylight saving
combinations (for instance Adelane, Australia) the result is not correct.

Can anybody tell me what I'm doing wrong?

//michael

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Technical Details
Message-ID: <op.ufifwanvhrxo93@mtpc>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,72d268c072426e86
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 07 Aug 2008 11:42:00 +0200
Subject: Timezone problems
From: "Michael Thomsen" <sorry@no.spam>
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Content-Transfer-Encoding: 7bit
Message-ID: <op.ufifwanvhrxo93@mtpc>
User-Agent: Opera Mail/9.27 (Win32)
NNTP-Posting-Host: 130.225.77.198
X-Trace: newsgroups.borland.com 1218102115 130.225.77.198 (7 Aug 2008 02:41:55 -0700)
Lines: 20
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
X-Original-Bytes: 1441