Article View: comp.os.msdos.programmer
Article #2836Turbo C time conversion -- Please help
From: =Tamboer Erik
Date: Mon, 29 Oct 1990 11:37
Date: Mon, 29 Oct 1990 11:37
27 lines
1823 bytes
1823 bytes
I use a shell program I wrote in Turbo C. On the status line it displays
the current time and date. This is retrieved using getdate(), gettime(),
unixtodos() and ctime() (not just time() and ctime() because I need the
time and date structures elsewhere, too).
I recently switched from TC 2.0 to TC++ 1.00 and now I noticed that
since October 28 the clock is one hour fast. DOS reports the correct
time, but Turbo C adds one hour! I guess this has got something to do
with timezones and daylight savings time, but I need the clock to report
the time as DOS knows it, and I don't want to use the TZ environment
variable for several reasons.
Is there a way to get Turbo C to convert DOS time to a string without
trying to add hours, or does one need to write one's own version of
ctime() (I would do this if I knew how) ?
By the way, the struct time (after a call to gettime()) contains the
correct time, but the companion struct date does not say what day of the
week it is, which I also need.
With Turbo C 2.0 the problem does not occur (I can check this, because I
kept a version compiled with 2.0 around.)
Any help is appreciated,
Erik Tamboer
--
____________________ ________________________________________
/ Erik Tamboer /\__ / I would have included a really funny /\__
/ tamboer@cs.vu.nl /__\/ / joke here, but I already logged out. /__\/
/___________________/ /_______________________________________/
Technical Details
Message-ID:
<8065@star.cs.vu.nl>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!tamboer@cs.vu.nlShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!tamboer@cs.vu.nl From: tamboer@cs.vu.nl (=Tamboer Erik) Newsgroups: comp.os.msdos.programmer Subject: Turbo C time conversion -- Please help Message-ID: <8065@star.cs.vu.nl> Date: 29 Oct 90 11:37:40 GMT Sender: news@cs.vu.nl Organization: Fac. Wiskunde & Informatica, VU, Amsterdam Lines: 27