POSIX::mktime problem on linux.

  • Permalink
  • submit to reddit
  • Email
  • Follow


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
Reply forvaidya (2) 5/24/2006 9:15:55 AM

See related articles to this posting


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
Reply Daniel 5/24/2006 10:10:40 AM
comp.lang.perl.misc 32800 articles. 7 followers. Post

1 Replies
263 Views

Similar Articles

[PageSpeed] 59


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Linux, ISE 7.1, problems, problems, problems ....
ok, ok we've beaten this subject to death already .... I just had this really radical and crazy idea: XILINX, how about a BETA program ? I mean one before you burn the CDs and make a product announcement and we are stuck with a useless plastic disc. If I look at all the issues that people are having with 7.1, they are all so trivial and easy to to solve (include a few libs, distribute a statically linked setup program, etc.). I'm sure a few of us with subscription would volunteer to test drive a pre-release version of your s/w. - I know I would. Wouldn't that be much nicer t...

Linux to Linux Fileshare Problem
I have two old desktops both running Ubuntu Linux, I also have an XP laptop all working behind a draytek 2600 router. Samba is set up on both Linux machines, my XP machine can access both Linux machines and both Linux machines can access the XP laptop. Problem is neither Linux machine can view the other's files. If from either Linux machine I connect to the network it shows the other Linux machine, clicking on the networked Linux machine it then lists the shared directories but if I click on the directories a window opens requesting a username, domain and password. The username sh...

NSA, Linux posixers, how Linux is a failure
Comment on Cybersecurity, open OSen, and Stuxnet, to the NSA Hello NSA. I'm the first person ever banned from linux-kernel. I was banned for spewing hackish off-topic stuff like a working stack machine interpreter daemon, "Why the Plan 9 C compiler doesn't have asm("")", and a packages-friendly internationalization of the file names tree. Appended below is a trivial shell function that gets rid of make. The worst threat to US cybersecurity is the plague of machines running MSDoS+GUI on internetworked machines. Stuxnet, of course, attacks Mickeysoft. That was buri...

Linux Router/Firewall
I have been running a Linux Firewall/Router (192.168.1.1) for my WinXP computer for a while now and decided to change the client(192.168.1.4) to linux as well (mandrake). The strange thing is that I'm not able to connect Linux->Linux now. I get no ping reply from ether client to router or the other way around. Tcpdump shows some arp traffic though. Both computers can ping their own ip and loopback without problems. Any pointers? Fry wrote: > Linux->Linux now. I get no ping reply from ether client to router or the > other way around. Tcpdump shows some arp traffic though. ...

Linux: tons of problems XP: one problem
"My friend is a linux lover...Linux gives him tons of problems (he uses PCLOS) and he always talks about how good it feels to fix problems in Linux, yet when his XP install gives him ONE PROBLEM after three years he starts talking shit about microsoft." #9 at http://www.dvorak.org/blog/?p=14453 A perfect description of many of the luser hypocrites that populate the Linux world. Micoshaft fraudster DFS wrote on behalf of half wits from Micoshaft Corporation: > when his XP install gives him ONE PROBLEM after three years he > starts talking shit about microsoft." #9...

Not able instal linux(problem in partioning the Linux)
i have Windows xp in my system, i am using 80gb hard disk. in that i have used 70 GB for windows Xp and i left 10 GB free for Linux.... i want to install Red hat linux 9.0. I can boot the red hat linux for the installation but when i go to the step of partitioning for linux. i can make only two partitions like /, and /boot.. or swap and /, or any two combinations if i go for the... more =BB by kirankumar.277@gmail.com - 11:53am - 1 new of 1 message ...

Problem backing up files on linux machine ( linux newbie )
I have a problem backing up files on my Linux machine. I have tried using tar and cpio but the file exceeds the 32 bit file size limit of 2 GB. Ideally I would like a backup that was a replication of the file system so I could access the files individually not in an archive I also want to exclude the filesystem I am writing the backup too for obvious reasons. Can anyone help pls. Don Try using the tar command as a pipe with an exclude file. This example will backup the machine from the / mountpoint recursively excluding the filesystem mounted on /mnt where the backup will be held. # Creat...

Linux problems
So, last night, I'm surfing the Web on my home Mint machine, and, without warning, a kind and generous Web site gave my machine a free virus scan! And thank goodness - look at all the badness that was found!! http://i54.tinypic.com/2w6waz6.png I thought this result a bit odd, since Mint has no C: drive, but I trusted that "Windows Web Security" was ready to remove all the nasty viruses and trojans, so I downloaded the program, softupdate107_2263.exe. But the program will not run! What am I to do now?!?! How do I get these nasties off my Linux machine for good? Ma...

Major Linux Problems The 2012 Edition. Why Linux is not ready for the desktop.
Great reading which exposes the seamy underbelly of Linux. BTW for a wonderful example of the childish, cult like Linux community attempting to defend Linux, read the comments. Is this like the 5th grade or something? No, it's your Linux community hard at work. The very same people you will go to for help with Linux when it tanks on you, and it will. Enjoy! http://linuxfonts.narod.ru/why.linux.is.not.ready.for.the.desktop.current.html Torre Starnes wrote: > Great reading which exposes the seamy underbelly of Linux. and the true nature of online trolls trying it on ...

Linux problem
I have DELL E560 computer i want to install linux any linux (Red hat Linux,SUSE) but when i boot the machine with Linux CD it's boot but after select language and keyboard it promting for cd rom and showed following error, Could not find the SUSE linux installation CD Activating manual setup program if select ok it's showed following error you can leave linuxrc only via "start installation or system" you may need to load some drivers (modules) to support your hardware Can i have solution on this problem jpednekar26@gmail.com wrote: > I have DELL E560 computer i want...

Problems with mktime
I'm trying to write a program that will show the time at various different places. The idea is to get the GMT time, adjust it for the correct time zone offset (including DST if appropriate) and display it. My first attempt (limited to BST) would use gmtime to get GMT, add 1 to the tm_hour member, knock off 24 if the adjusted hour exceeded 23, and show it. This worked OK. However, I discovered the function mktime which I though might provide a more general solution. As I understand it, if you pass it a struct in which the number of the hour is outside the proper range, it will adjust things...

Linux Problems
I want to find out whether a user is logged into my computer through > the RS232 serial port. > For FC6 (kernel 2.6.18-1.2798), the environment variable > TERM will be set to "linux" for serial port login. > Isn't it? > For all types of log in, then TERM will be set to something else, > right? At runlevel 3, do Alt-Ctrl-F1, log in, and do "echo $TERM". On my system, that produces "linux". Cesar Onofre Kawase kws8207 schrieb: > > I want to find out whether a user is logged into my computer through > the RS232 serial port. > For ...

a few linux problems
thanks everyone for replying to my previous post. well, this is what i did. like a smartass, i installed debian linux over my windows installation... n then i realise that the distribution doesn't come with drivers(sound, etc.), or maybe i just couldnt figure out how to 'do' the drivers. well, so i install windows again leaving free space on the hd, n then install mandrake community linux 10.0. this did detect the sound card during the installation, and did something else about the graphics. problem is... it still cant do a thing about videos... not the normal ..dat files, not t...

Linux lusers deny the reality of Linux bugs and security problems
The article is old, but the petulant Linux lying cultist behavior is as prevalent as ever. http://www.informationweek.com/news/windows/showArticle.jhtml?articleID=6500344 On Tue, 3 Jun 2008 10:57:10 -0400, DFS wrote: > The article is old, but the petulant Linux lying cultist behavior is as > prevalent as ever. > > http://www.informationweek.com/news/windows/showArticle.jhtml?articleID=6500344 Things in the world of Linux never change. Take Linux's desktop market share for example. Still sitting at 0.6 percent even after 16 years! The Linux cultists will always LIE for...

The problem with Linux.....
Linux just runs. It stays running for a long time. You start a machine and a year later you have to move it or something. Then you have to remember what you did a year ago. __/ [ mlw ] on Friday 11 August 2006 14:56 \__ > Linux just runs. It stays running for a long time. You start a machine and > a year later you have to move it or something. Then you have to remember > what you did a year ago. I sometimes forget what the bootloader looks like. I sometimes what the login manager looks like. I rarely save work/messages as I go along because, quite frankly, rarely will anything go...

Linux problems...
What am I doing wrong? I see all these linux problems out there, but I am having trouble getting my own problems. 64 bit machines are supposed to be a problem, and yet this one has run a 64 bit OS since late 2005. 64 bit is also supposed to be slower, but the linux OS here shaves 23% of video compression times. Ipods are not supposed to work, and yet I plug them in here and amarok recognizes it straight away and lets me transfer music. Bummer. TV cards aren't supposed to work, and yet I buy a card and put it in, and I get a tv player pop up on the desktop. I can record video AV in s...

Problem with Linux
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Linux will spoil a whole weekend... So many free programs that are soooo good. Yesterday I pulled from the repository Marble and Stellarium. Sooooooooo distracting. So good. Be careful with Linux. With so many quality programs a click away it can totally ruin your whole weekend. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkqtd9oACgkQU4xAY3RXLo7nQACfajOb70Frmn7wKk4GaaVihB7Q oLYAoJ30RmbYu6OYHHt3/F5yJDHOsLX4 =0itY -----END PGP SIGNATURE----- On Sun, 13 Sep 2009 23:53:14 +0100, Roy Schestowitz wrote: > -...

linux problem
hello, first of all, i suppose i better say that i'm an absolute n00b with linux.. i'm using slackware 10 atm.. i want to get isdn going.. where do i start? i have two modems, one internel asuscom isdnlink, and another external dreytek one.. i dont mind which one i get going, so long as i get on 64k.. i downloaded and installed isdn4k-utils, but i dont have a clue how to use it.. just way to complicated for me.. are there any good graphical tools i can use to configure my modem(s)? or can anyone please point me to some good howto's or documemtation on isdn for linux (i did try goo...

Problem Converting Linux PC to Dual-Boot (XP, Linux)
I have a Fedora Core 2 Linux PC (Dell Optiplex GX60) that I need to convert to a Dual-Boot machine (WIndows XP, Fedora Core 6). I installed XP, wiping out the existing Linux, but when I go to partition the disk via Knoppix/qtparted, the Knoppix CD is not seen on boot, it goes right to WIndows every time. I suspect this is due to the fact that there was a pre-existing Linux install. So: what needs to be done here so I can run qtparted from Knoppix, partition the disk, install FC6 on the back half the disk and get this done? Thanks, -Richard Vaughn On Thu, 30 Aug 2007 15:16:18 -0000, Richa...

The Problems With Linux
Here are the problems with Linux: o it is made by people (some of whom have beards) who openly call themselves hackers; o it involves stolen copyrighted code from a highly reputable company; o the priorly-assumed creator of it admitted this week that he didn't in fact create it, but was posing as front man for the real creators; o it is for geeks; o it is too hard for most people to understand; and o running programs in it takes too much effort: we want to double-click! Bye Suzie wrote: > Here are the problems with Linux: > > o it is made by people (some of whom have beard...

Strange problem: no problem with Linux, when I boot windows 2K network is down...
Guys: This is very strange problem, looklike this problem is not going to leave me for months. I have a computer with Windows2K and Linux. I have Netgear 4-port Switch/Router (connected to DSL modem). If I boot with Linux, everything is OK, I can be on-line, also two of my other computers works fine. If I boot my PC with Win2K, then immediately all computers are down. None of the computer connected to network. I thought some problem with LAN card, so I went for early bird sale on day after Thanksgiving and I got one LinkSys PCI LAN card and one Router and I plugged new LAN card into my machin...

Linux problem
I just installed the x86_64 version of maple 10 on my ubuntu linux desktop, but I can't figure out why xmaple won't run. Installing in the first place was a bit of a pain: I had to use the '-i console' parameter, and once it was installed, I had to chmod +x the executables and replace the maple10/jre.X86_64_LINUX/bin and maple10/jre.X86_64_LINUX/lib directories with links to my current java version's (1.5.0_06) directories. I had no problem activating, and plain old console 'maple' runs fine, but nothing happens when I try to run 'xmaple' or 'map...

Posix Problems
I am working on a 918LX possessing a clean install of c.75.00 with PP2 applied. I diligently followed the instructions on how to get a working .exrc file for vi created and had no luck. I finally gave up and imported my own .exrc from one of my Linux boxes and discovered that it does not work either. Researching the matter further I ran across an old posting from d.g. on the list and discovered that the HOME variable must be set in order that vi read any provided .exrc file. The thing is that there is no HOME environment variable set by the HP3000 when MANAGER.SYS logs on...