Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Format user entered date?

by astroboy (Chaplain)
on Sep 01, 2009 at 00:40 UTC ( #792501=note: print w/replies, xml ) Need Help??

in reply to Format user entered date?

#!/usr/local/bin/perl use DateTime::Format::Natural; my @dates = ('Yesterday', '21st August 2009', '2009-07-17 2:35pm'); my $output_format = '%d/%m/%Y %H:%M:%S'; foreach my $date (@dates) { my $parser = DateTime::Format::Natural->new; my $dt = $parser->parse_datetime($date); print $dt->strftime($output_format), "\n";; }
31/08/2009 00:00:00 21/08/2009 00:00:00 17/07/2009 14:35:00

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://792501]
[stevieb]: Torturing one of my dev RPis to turn four 5v stepper motors at the same time (via Parallel:: ForkManager for 50k degrees (a whole lot of full turns!). Let's see if it burns out or not.
[stevieb]: My GPIO expander chips should arrive tomorrow, but I think I'll throw a shift register against them and see if all six I have will turn at once. Amps are near the breaking point, but I want to know max sustainable V and I output.

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2018-03-22 22:18 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (286 votes). Check out past polls.