T
Tgone
Hello,
I'm having problems with HTTP:ate displaying the wrong hour and
seconds.
I'm having problems with HTTP:ate displaying the wrong hour and
seconds.
Tgone said:I'm having problems with HTTP:ate displaying the wrong hour and
seconds.
print "$month/$day/$year @ $hour:$min\n";
-------------------------------------------------------------
This returns: 4/20/2006 @ 02:24
Any ideas?
Tgone said:I'm having problems with HTTP:ate displaying the wrong hour and
seconds.
-------------------------------------------------------------
$timestr = "2006-04-29 15:00:00";
my ($year, $month, $day, $hour, $min, $sec, $tz) =
parse_date(time2str($timestr));
print "$month/$day/$year @ $hour:$min\n";
Sherm Pendley said:Aha! The docs for str2time() state that, if a time zone other than "GMT"
or a numeric value is given, the module Time::Zone must be installed for
the string to be parsed correctly.
Sherm said:If I change your code to this:
$timestr = "2006-04-29 15:00:00";
my ($year, $month, $day, $hour, $min, $sec, $tz) =
parse_date(time2str(str2time($timestr)));
Gunnar Hjalmarsson said:Why not just parse_date($timestr) ?
Tgone said:it should be parse_date($timestr) not parse_date(time2str($timestr))
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.