Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Is there a way of storing 600 in a scalar as 0600 (24 hour clock style)?

by nardo (Friar)
on Aug 15, 2000 at 17:58 UTC ( [id://27931]=note: print w/replies, xml ) Need Help??


in reply to Is there a way of storing 600 in a scalar as 0600 (24 hour clock style)?

sprintf('%04d', 600);
  • Comment on Re: Is there a way of storing 600 in a scalar as 0600 (24 hour clock style)?
  • Download Code

Replies are listed 'Best First'.
Re: Answer: Is there a way of storing 600 in a scalar as 0600 (24 hour clock style)?
by lemming (Priest) on Dec 26, 2000 at 23:21 UTC
    This way works, but you'll want to be careful with this method.
    sprintf("%04s %04s %04s", 600, "0600", 0600);
    Results in: "0600 0600 0384"
    Octal can get you.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-26 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found