P is for Practical | |
PerlMonks |
WWW::Mechanize wrong monthby gsparx (Novice) |
on Oct 31, 2012 at 04:47 UTC ( [id://1001595]=perlquestion: print w/replies, xml ) | Need Help?? |
gsparx has asked for the wisdom of the Perl Monks concerning the following question: Hello Perl Monks, I am having an issue with pulling server time information from a server, and my own computer in fact. I am running perl inside of a Windows Citrus Perl environment, but I see a similar issue in Ubuntu as well. I am pulling the time/date from a server with $servertime = ($mech->response()->header("Date"));and the local time with $loctime = localtime(time);but I'm getting the wrong date returned. For example, it is currently October (and it displays this on my computer's clock) but when I call the above code, and then parse it with
I get the following two values: 112 9 31 04 25 06 112 9 30 21 25 05 The above date says that it's September, and since I'm trying to then use Delta_DHMS, it complains that it's an invalid date because I'm trying to tell it that it's September 31...which it's obviously not. Can anyone think of an easy way to just increment the month so it's 10, or why I might be getting the wrong month from both this server and my own local machine? Thanks for your help, Garrett
Back to
Seekers of Perl Wisdom
|
|