* Jm lists <[EMAIL PROTECTED]> [2006-11-15T09:57:44]
> Hi members,
> 
> I want to get this format of time:
> 
> 11.07.06 12:00 pm
> 
> can you tell me how to get it?(maybe need to be translated from the
> 'localtime') Thanks.

Consult "perldoc -f localtime":

  #    0    1    2     3     4    5     6     7     8
  my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;

  $string = sprintf '%02u.%02u.%02u %02u:%02u %s',
    $mon + 1,
    $mday,
    substr($year, -2, 2),
    $hour % 12,
    $min,
    ($hour > 12 ? 'pm' : 'am');

  print "$string\n";

Is all of that clear?

-- 
rjbs

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to