Re: Date function



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? ;-)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.



Relevant Pages

  • Re: ways to change the first char from a filename (with full path)
    ... Gunnar Hjalmarsson wrote: ... > Rod Za wrote: ... >> change the first char of the filename. ...
    (perl.beginners)
  • Re: Regex Question
    ... I'm trying to check if the filename pulled from the database table ... Regex, ... follows some prefix string, I'd expect NTFS to use its B-tree to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Regular expression
    ... > I want to split the filename and the path. ... > as input to fetch the file from a remote machine through ftp.. ... > with the slashes in it.. ... Gunnar Hjalmarsson ...
    (comp.lang.perl.misc)
  • Re: Date function
    ... Gunnar Hjalmarsson wrote: ... would give you the prefix string for your filename. ... So my method would mess up on one of the DST changeovers if it ran between midnight and 0100 local. ...
    (comp.lang.perl.misc)
  • Re: Compare two files
    ... Jeff Pang wrote: ... ls -la May 12 2003 filename ... I would use stat, localtime() and timelocalinstead. ... Gunnar Hjalmarsson ...
    (perl.beginners)