Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: How do I remove newline character from a number got from unix command

by Tux (Monsignor)
on Sep 04, 2013 at 12:37 UTC ( #1052326=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How do I remove newline character from a number got from unix command
in thread How do I remove newline character from a number got from unix command

my $date_as_YYYY_MM_DD = do { my @d = localtime; sprintf "%04d-%02d-%02d", $d[5] + 1900, ++$d[4], $d[3]; };

but that is most likely better done with POSIX' strftime:

use POSIX qw( strftime ); my $d_YMD = POSIX::strftime ("%Y-%m-%d", localtime); my $d_Md = POSIX::strftime ("%d %b", localtime); # I prefer 04 Sep ov +er Sep 04

Enjoy, Have FUN! H.Merijn


Comment on Re^3: How do I remove newline character from a number got from unix command
Select or Download Code
Re^4: How do I remove newline character from a number got from unix command
by tousifp (Novice) on Sep 04, 2013 at 15:45 UTC
    t a n k s!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2014-07-14 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (255 votes), past polls