Re: getting $date
- From: "A. Sinan Unur" <1usa@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 May 2005 12:43:28 GMT
Graham Gough <graham@xxxxxxxxxxxx> wrote in
news:ttlu0kjy6ja.fsf@xxxxxxxxxxxxxxxxxxx:
[ Please quote some context when you reply.]
> #!/usr/bin/perl
>
> use strict;
use warnings;
missing.
> my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
> localtime();
my ($mday, $mon, $year) = (localtime)[3 .. 5];
> $year += 1900;
> $mon++;
>
> my $date = "$mday/$mon/$year";
>
> print $date, "\n";
printf "%2.2d/%2.2d/%4.4d\n", $mday, $mon + 1, $year + 1900;
Sinan
--
A. Sinan Unur <1usa@xxxxxxxxxxxxxxxxxxx>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
.
- Follow-Ups:
- Re: getting $date
- From: Graham Gough
- Re: getting $date
- References:
- getting $date
- From: spam
- Re: getting $date
- From: Graham Gough
- Re: getting $date
- From: spam
- Re: getting $date
- From: Graham Gough
- getting $date
- Prev by Date: Re: getting $date
- Next by Date: Re: Invisible variables in Perl debugger II
- Previous by thread: Re: getting $date
- Next by thread: Re: getting $date
- Index(es):
Relevant Pages
|
|