Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: date conversion

by Rahul6990 (Beadle)
on Jul 18, 2013 at 06:34 UTC ( [id://1044979]=note: print w/replies, xml ) Need Help??


in reply to date conversion

Hi ,

One option is to use regex:
my $in_date = '051407'; (my $db_date = $in_date) =~ s/(\d\d)(\d\d)(\d\d)/$1-$2-$3/; print ":$db_date:";

But there is one issue how would you find that date belongs to 20th century or 21st
Example:
The above date could be :05-14-2007 or 05-14-1907

And one advise its always better to search before you post a question.

Replies are listed 'Best First'.
Re^2: date conversion
by zork42 (Monk) on Jul 18, 2013 at 06:53 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1044979]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-24 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found