Forum Moderators: coopster & phranque
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); print "$mon/$mday/$year";
but that code always gives me 9/8/104. How can I format it so it is MM/DD/YY? I really need an answer fast. Thanks in advance
add:
$year=$year+1900;
#!/usr/bin/perl use Date::Format;
print time2str("%D", time), "\n"; # (prints 10/09/04)
print time2str("%m/%d/%Y", time), "\n"; # (prints 10/09/2004)
Look up ISO 8601 and RFC 3339 for the International Format, which is always YYYY-MM-DD.