Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Creating a string for a date stamp

by danboo (Beadle)
on Sep 20, 2001 at 00:39 UTC ( [id://113469]=note: print w/replies, xml ) Need Help??


in reply to Creating a string for a date stamp

i'd recommend sprintf here:
sub get_time_stamp() { my @tan=Today_and_Now(); my $stamp= sprintf '%d%02d%02d%02d%02d', @tan[0..4]; return $stamp; }
or the brief version:
sub get_time_stamp() { sprintf '%d%02d%02d%02d%02d', (Today_and_Now())[0..4]; }
this will keep all all the potential 1 or 2 digit fields padded with a zero. cheers, - danboo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-26 01:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found