[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#523280: marked as done (localtime doesn't count leap seconds near 2038)



Your message dated Mon, 14 Mar 2016 00:42:32 +0100
with message-id <20160313234232.GA25059@aurel32.net>
and subject line Re: localtime doesn't count leap seconds near 2038
has caused the Debian Bug report #523280,
regarding localtime doesn't count leap seconds near 2038
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
523280: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523280
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libc6
Version: 2.7-18

I found that date command doesn't work well with leap
seconds after 2037-11-01 with right/EST5EDT timezone.

% TZ=right/EST5EDT date -d @2140668023
Sun Nov  1 01:59:59 EDT 2037
% TZ=right/EST5EDT date -d @2140668024
Sun Nov  1 01:00:24 EST 2037

The second after 01:59:59 EDT should be 01:00:00 EST, not
01:00:24 EST.

It seems a problem of localtime().

% cat localtime.c 
#include <stdlib.h>
#include <stdio.h>
#include <time.h>

int main(int argc, char *argv[])
{
  time_t t;
  struct tm *tmp;

  t = atol(argv[1]);

  tmp = localtime(&t);
  if (tmp == NULL) { fprintf(stderr, "localtime error\n"); exit(1); }

  printf("%d-%02d-%02d %02d:%02d:%02d %s %s (%ld) %ld\n",
    tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
    tmp->tm_hour, tmp->tm_min, tmp->tm_sec,
    tmp->tm_isdst > 0 ? "dst" : tmp->tm_isdst == 0 ? "std" : "unknown",
    tmp->tm_zone, tmp->tm_gmtoff,
    t);

  return 0;
}
% gcc -Wall localtime.c
% TZ=right/EST5EDT ./a.out 2140668023
2037-11-01 01:59:59 dst EDT (-14400) 2140668023
% TZ=right/EST5EDT ./a.out 2140668024
2037-11-01 01:00:24 std EST (-18000) 2140668024

% dpkg -l|grep libc6
ii  libc6                                2.7-18                      GNU C Library: Shared libraries
ii  libc6-dbg                            2.7-18                      GNU C Library: Libraries with debugging symbols
ii  libc6-dev                            2.7-18                      GNU C Library: Development Libraries and Header Files
ii  libc6-i686                           2.7-18                      GNU C Library: Shared libraries [i686 optimized]
% dpkg -l|grep tz   
ii  tzdata                               2008h-2                     time zone and daylight-saving time data
% uname -a
Linux nute 2.6.26-1-486 #1 Fri Mar 13 17:25:45 UTC 2009 i686 GNU/Linux

This problem may be related to #522949.
"TZ=Egypt date -d 'Dec 1 00:00:00 2037' prints UTC date."
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=522949
-- 
Tanaka Akira



--- End Message ---
--- Begin Message ---
Version: 2.11.1-1

On 2009-04-09 14:55, Tanaka Akira wrote:
> Package: libc6
> Version: 2.7-18
> 
> I found that date command doesn't work well with leap
> seconds after 2037-11-01 with right/EST5EDT timezone.
> 
> % TZ=right/EST5EDT date -d @2140668023
> Sun Nov  1 01:59:59 EDT 2037
> % TZ=right/EST5EDT date -d @2140668024
> Sun Nov  1 01:00:24 EST 2037
> 
> The second after 01:59:59 EDT should be 01:00:00 EST, not
> 01:00:24 EST.
> 
> It seems a problem of localtime().

This actually upstream bug BZ 10211. It has been fixed in upstream
version 2.11 and thus in 2.11.1-1 in Debian. Closing the bug.

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

--- End Message ---

Reply to: