Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

RE: Re: Date format question

by BlaisePascal (Monk)
on Sep 12, 2000 at 03:19 UTC ( #32019=note: print w/replies, xml ) Need Help??


in reply to Re: Date format question
in thread Date format question

Try:
printf("%4d.%02d.%02d\n",$year+1900,$month,$day);
That is, if you don't want today's date to be printed as 100.09.11

You might want to use sprintf if you are trying to get it in a string.

Replies are listed 'Best First'.
RE: RE: Re: Date format question
by myocom (Deacon) on Sep 12, 2000 at 03:22 UTC

    Actually, you'll also want to use $month+1...

    printf("%4d.%02d.%02d\n",$year+1900,$month+1,$day);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://32019]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2018-10-23 07:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (125 votes). Check out past polls.

    Notices?