From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: Calculating Time Zones Date: Sun, 07 Oct 2001 14:39:44 +0200 Lines: 25 Message-ID: <3BC04D10.7DF67D8B@is.elta.co.il> References: NNTP-Posting-Host: 192.116.55.139 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1002458362 20835087 192.116.55.139 (16 [61365]) X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Radical, NetSurfer wrote: > > Using DJGPP 2.03/GCC 2.95.3, I want to create a > program that does nothing more than report what > > 1) my local time is > > 2) and the local times of friends living around the world > > 3) calculating the difference between time zones > > 4) setting alarms for each unique time zone, etc. > > Obtaining local time should be easy enough... > > How difficult will it be to add and subtract several hours > from my local time, in order to get accurate obtain times > elsewhere in the world... You should already have everything you need in the library, provided that you install djtzn203.zip (see section 22.20 of the DJGPP FAQ for more details about djtzn203.zip files). In particular, setting the TZ environment variable to that of the other places will return information as if you magically moved to that timezone. (You can set TZ from a running program with the setenv or putenv library functions.)