Willman023 has asked for the wisdom of the Perl Monks concerning the following question:
TimeStamp($date_created); #$date_created is YYYYMMDD
Where I want $date_created to be directly reformatted to MMDDYYYY, without using a module. Right now I'm using 5 functions to do the same thing :(
Thanks for any ideas!sub TimeStamp($) # Pass the stamp in as YYYYMMDD { $_=$_[0]; if( /(\d{4})(\d{2})(\d{2})/ ) { #returns in MMDDYYYY $date_created = "$2/$3/$1" } else { warn "Invalid input to TimeStamp()" } }
|
|---|