POSIX::mktime problem on linux.

F

forvaidya

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
 
D

Daniel Fischer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top