delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/17/05:01:19

Date: Wed, 17 Dec 1997 12:00:58 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Dim Zegebart <zager AT post DOT comstar DOT ru>
cc: DJGPP Mail List <djgpp AT delorie DOT com>
Subject: Re: Time and Date problem
In-Reply-To: <349622D3.1E4C@post.comstar.ru>
Message-ID: <Pine.SUN.3.91.971217120017.28294R@is>
MIME-Version: 1.0

On Tue, 16 Dec 1997, Dim Zegebart wrote:

> And then call settime() to synchronize real and system timers.
> 
> { struct time now;
>   real_time_clock(0,&now);
>   settime(&now);
> }
> Everething is Ok until midnight - then time is 0:0:0 settime() increase
> the date but then the time become 0:0:1 it sets date to the old
> value :( What is my problem and how can I solve it ?

I'm not sure what problem are you trying to solve with the above code.
AFAIK, in DOS 3.3 and later, `settime' will also set the time
maintained in the CMOS clock.  So your code is constantly slowing down
the system clock (due to the time that passes between the two calls).
It's probably not what you want, and it even might be the reason
behind the strange effects around midnight.

I suggest to try the BIOS call for setting the system time instead
(either the Borland-like `biostime' or the MS-like `_bios_timeofday'
function).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019