S
Sergei Shelukhin
I have mysql database with datetime column PDT in the table Record. I run
the following:
my ($startdate) = $db->selectrow_array("SELECT MIN(PDT) FROM Record");
print "$startdate"; # prints out datetime ~half a hour ago from this message
post
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($startdate);
for my $scalar ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
{ print "$scalar<br />"; }
#prints out:
24
33
21
31
11
69
3
364
0
The date is ok; the values are obviously not.
What's wrong with that?
Is the date returned from selectrow statement really just a string? And if
yes, what's its workaround ( e.g. is it in the same format everywhere, on
all servers and what do I do if it is not
)?
the following:
my ($startdate) = $db->selectrow_array("SELECT MIN(PDT) FROM Record");
print "$startdate"; # prints out datetime ~half a hour ago from this message
post
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($startdate);
for my $scalar ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
{ print "$scalar<br />"; }
#prints out:
24
33
21
31
11
69
3
364
0
The date is ok; the values are obviously not.
What's wrong with that?
Is the date returned from selectrow statement really just a string? And if
yes, what's its workaround ( e.g. is it in the same format everywhere, on
all servers and what do I do if it is not