Hello,lists,
Please see these two lines' output:
[$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,8,2006)'
Day '31' out of range 1..30 at -e line 1
$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,2006)'
1156953600
I translate the time of '2006-7-31 00:00:00' to unix
Because SEPTEMBER only has thirty days.
0 - January; 1 - February; 2 - March; ...
--L
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
On 8/29/06, Practical Perl [EMAIL PROTECTED] wrote:
But when I translate the time of '2006-8-31 00:00:00' to unix timestamp,it
said '31 out of range'.
I'm so faint that August doesn't have 31th day?Please tell me why this
happen and how to resolve it.
from perldoc Time::Local
It is
Thank you,:-)
For the intuition I treated '8' as August in Time::Local's method...A
low-level mistake.
2006/8/30, Lawrence Statton XE1/N1GAK [EMAIL PROTECTED]:
Because SEPTEMBER only has thirty days.
0 - January; 1 - February; 2 - March; ...
--L
--
To unsubscribe, e-mail: [EMAIL
Practical Perl wrote:
Hello,lists,
Please see these two lines' output:
[$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,8,2006)'
Day '31' out of range 1..30 at -e line 1
$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,2006)'
1156953600
I translate the time of
Practical Perl wrote:
Hello,lists,
Hello,
Please see these two lines' output:
[$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,8,2006)'
Day '31' out of range 1..30 at -e line 1
$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,2006)'
1156953600
I translate
So if you want to translate 31 August 2006 you have to subtract one from the
month and 1900 from the year:
$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,106)'
1157007600
John,
For the instance described by you,both '2006' and '106' are right.
$ perl -Mstrict -MTime::Local -le
Jeff Pang wrote:
So if you want to translate 31 August 2006 you have to subtract one from the
month and 1900 from the year:
$ perl -Mstrict -MTime::Local -le 'print timelocal(0,0,0,31,7,106)'
1157007600
John,
For the instance described by you,both '2006' and '106' are right.
$ perl