Re: A Perl time question

  • From: "Humberto Rodriguez" <sub@xxxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 20 Aug 2010 10:58:42 -0400

Hello Storm:

Since it seems nobody has answered you, I'll give you my two cents' worth:

To break the function localtime into its components, do:

my ($nsec,$nmin,$nhour,$nday,$nmon,$nyear) = localtime(time);

HTH,

Humberto

  ----- Original Message ----- 
  From: Storm Dragon 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Thursday, August 19, 2010 9:20 PM
  Subject: A Perl time question


  Hi,
  I don't know very much about perl, and I can't seem to find the answer to 
this anywhere.
  I have this line in a script I am trying to modify slightly:
       print "--" . localtime time . "\n\n";
  It produces a time stamp like:
  Thu Aug 19, 20:48 2010
  I would like it to just give the time in 12 hour format, as in:
  --09:19PM
  Is this a pretty simple modification?
  Thanks
  Storm
-- 
Registered Linux user number 508465:
http://counter.li.org/
Follow me on Twitter:
http://www.twitter.com/stormdragon2976
My blog, Thoughts of a Dragon:
http://www.stormdragon.us/
Get yourself a Frostbox:
http://www.frostbitesystems.com/
PULL MUH FANGER!
http://is.gd/bowEl


       

Other related posts: