perl - Trying to use DateTime. What's wrong? -


i trying datetime out todays date in %d/%m-%y' format, undef.

what doing wrong?

#!/usr/bin/perl  use strict; use warnings; use data::dumper;  use datetime (); use datetime::format::strptime;  $now   = datetime->now;  $p = datetime::format::strptime->new(     pattern     => '%d/%m-%y',     time_zone   => 'utc',     );  $dt = $p->parse_datetime($now);  print dumper $dt; 

it written simple as:

#!/usr/bin/env perl  use strict; use warnings;  use datetime ();  $now = datetime->now( 'time_zone' => 'utc' ); print $now->strftime('%d/%m-%y'); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -