Message-ID: <349622D3.1E4C@post.comstar.ru> Date: Tue, 16 Dec 1997 09:42:27 +0300 From: Dim Zegebart Reply-To: zager AT post DOT comstar DOT ru Organization: Comstar Ltd. MIME-Version: 1.0 To: DJGPP Mail List Subject: Time and Date problem Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Hi, I have a strange problem with setting date and time in my program. I read realtime clock by the mean of function : int real_time_clock(int cmd,struct time *real_time) { __dpmi_regs r; int tmp; if (cmd==0) //read real time clock { r.h.ah = 0x2; __dpmi_int(0x1a, &r); real_time->ti_hour=bcd2bin(r.h.ch); real_time->ti_min=bcd2bin(r.h.cl); real_time->ti_sec=bcd2bin(r.h.dh); real_time->ti_hund=0; } else { r.h.ah = 0x3; r.h.ch=real_time->ti_hour; r.h.cl=real_time->ti_min; r.h.dh=real_time->ti_sec; __dpmi_int(0x1a, &r); } return (1); } 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 ? -- Regards, Dim Zegebart, Moscow Russia. Ghostly basement : http://www.geocities.com/siliconvalley/pines/7817 DZCOMM - comm library for Allegro