Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Get time without seconds

by LanX (Canon)
on Mar 25, 2013 at 00:23 UTC ( #1025201=note: print w/ replies, xml ) Need Help??


in reply to Get time without seconds

Whats wrong with replacing %r with the appropriate placeholders for hour, minute and AM/PM but excluding seconds?

from Date::Format

... %H hour, 24 hour clock, leading 0's) %I hour, 12 hour clock, leading 0's) %j day of the year %k hour %l hour, 12 hour clock %L month number, starting with 1 %m month number, starting with 01 %M minute, leading 0's %n NEWLINE %o ornate day of month -- "1st", "2nd", "25th", etc. %p AM or PM ...

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Re: Get time without seconds
Download Code
Re^2: Get time without seconds
by Anonymous Monk on Mar 25, 2013 at 00:46 UTC
    What about this:
    $today_time = time2str( "%I:%M %p", time);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-12-26 23:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls