G
GGelz
Hi all,
I'm having quite a bit of trouble simply getting a date using perl on
a winXP system.
First of all, if I do something like:
$date = `date /T`;
I'll get an error saying:
date: invalid date '/T'
on the console.
Now, I was able to work around this by just doing a:
$date = localtime(time);
printing $date gives
"Fri Feb 2 12:23:11 2007"
now, if I split it using
($day, $month, $monthday, $time, $year) = split(/\s/, $date);
and then print out all the values, this is what I get:
$day = Fri
$month = Feb
$monthday =
$time = 2
$year = 12:23:11
I have no idea what is happening between "Feb" and "2" but it is
driving me crazy.
There has to be an easier way to handle dates in Windows using perl.
Will someone clue me in, please?
Thank you!
I'm having quite a bit of trouble simply getting a date using perl on
a winXP system.
First of all, if I do something like:
$date = `date /T`;
I'll get an error saying:
date: invalid date '/T'
on the console.
Now, I was able to work around this by just doing a:
$date = localtime(time);
printing $date gives
"Fri Feb 2 12:23:11 2007"
now, if I split it using
($day, $month, $monthday, $time, $year) = split(/\s/, $date);
and then print out all the values, this is what I get:
$day = Fri
$month = Feb
$monthday =
$time = 2
$year = 12:23:11
I have no idea what is happening between "Feb" and "2" but it is
driving me crazy.
There has to be an easier way to handle dates in Windows using perl.
Will someone clue me in, please?
Thank you!