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.