Re: Date function
- From: Gunnar Hjalmarsson <noreply@xxxxxxxxx>
- Date: Tue, 28 Nov 2006 23:56:47 +0100
boyd wrote:
In article <4t3qsqF11g6o6U2@xxxxxxxxxxxxxxxxxx>,
Gunnar Hjalmarsson <noreply@xxxxxxxxx> wrote:
boyd wrote:something like:
my( $day, $mon, $yr ) = ( localtime( time - 24*3600) )[3, 4, 5];
$yr += 1900;
$mon += 1;
my $str = sprintf '%4d-%02d-%02d', $yr, $mon, $day;
would give you the prefix string for your filename.
What about DST? ;-)
Good point. So my method would mess up on one of the DST changeovers if it ran between midnight and 0100 local. Is that right?
Yeah, that's what I'm thinking of. Maybe not a disaster in this case, but always worth considering when dealing with dates.
What is the "40000" for in your script?
That's 'approximately' 12 hours, i.e. well enough time to make the result DST safe. :)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- Follow-Ups:
- Re: Date function
- From: boyd
- Re: Date function
- References:
- Date function
- From: K.J. 44
- Re: Date function
- From: boyd
- Re: Date function
- From: Gunnar Hjalmarsson
- Re: Date function
- From: boyd
- Date function
- Prev by Date: Re: Date function
- Next by Date: Re: Date function
- Previous by thread: Re: Date function
- Next by thread: Re: Date function
- Index(es):
Relevant Pages
|
|