POSIX::mktime problem on linux.

mktime is broken on linux. POSIX::mktime doesn;t honor dst (daylight
saving flag) on linux. Works on solaris



Solaris version = SunOS water 5.9 Generic_112233-12 sun4u sparc
SUNW,Sun-Fire-V440
Linux version = Linux snow 2.4.21-15.ELsmp #1 SMP Thu Apr 22 00:18:24
EDT 2004 i686 i686 i386 GNU/Linux


#!/bin/perl
use POSIX;
print POSIX::mktime(0, 1, 1, 12, 12, 99,  0,  0,  0) , "\n" || die
"$!";
print POSIX::mktime(0, 1, 1, 12, 12, 99,  0,  0,  1) , "\n"|| die "$!";


Gives output on linux = (BAD).
947619060
947619060

Gives Output on solaris (looks good)
947619060
947615460
mvaidya@water:/home/mvaidya/TO_REMOVE>bc
947619060 - 947615460
3600

0
forvaidya (2)
5/24/2006 9:15:55 AM
comp.lang.perl.misc 33177 articles. 1 followers. brian (1246) is leader. Post Follow

1 Replies
471 Views

Similar Articles

[PageSpeed] 14

forvaidya!

> mktime is broken on linux. POSIX::mktime doesn;t honor dst (daylight
> saving flag) on linux. Works on solaris

No difference for me between

Linux chloris 2.6.16.9-diskless #1 SMP PREEMPT Fri Apr 21 15:51:49 CEST
2006 i686 GNU/Linux

and

SunOS mizar 5.10 Generic_118822-02 sun4u sparc SUNW,Sun-Blade-1000


However, this is not perl's fault anyway. POSIX::mktime calls the
underlying OS equivalent of mktime(). The behaviour of Linux mktime has
changed multiple times.


Daniel

0
Daniel
5/24/2006 10:10:40 AM
Reply: