Today's Date in Perl in MM/DD/YYYY format -


i'm working on perl program @ work , stuck on (what think is) trivial problem. need build string in format '06/13/2012' (always 10 characters, 0's numbers less 10).

here's have far:

use time::localtime; $tm=localtime; ($day,$month,$year)=($tm->mday,$tm->month,$tm->year); 

you can fast, using 1 posix function. if have bunch of tasks dates, see module datetime.

use posix qw(strftime);  $date = strftime "%m/%d/%y", localtime; print $date; 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -