Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Oct 2002 09:17:14 +0600
From:      Boris Kovalenko <boris@ntmk.ru>
To:        freebsd-stable@freebsd.org
Subject:   mktime problem?
Message-ID:  <3DAF7D3A.7060603@ntmk.ru>

next in thread | raw e-mail | index | archive | help
Hello!

First the simple source code:
#include <stdio.h>
#include <sys/time.h>

int main(int argc, char **argv)
{
    time_t      today = time( NULL );
    struct tm   temp  = *localtime( &today );

    temp.tm_hour = 24;
    temp.tm_min  = 0;
    temp.tm_sec  = 0;
    temp.tm_mday = 27;

    today = mktime( &temp );
    printf("%s\n", ctime( &today ));
    return 0;
}

I expect 28 Oct 00:00, but got 27 Oct 23:00. Why? Daylight saving should 
be at 28 Oct 02:00? My zoneinfo is Yekaterinburg.

-- 
Good Luck,
     Boris [Team OS/2]



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3DAF7D3A.7060603>