Create an Account
username: password:
 
  MemeStreams Logo

Perl ISO 8601 T Separated Formatting Code

search

Lost
Picture of Lost
My Blog
My Profile
My Audience
My Sources
Send Me a Message

sponsored links

Lost's topics
Arts
Business
Games
Health and Wellness
Home and Garden
Miscellaneous
Current Events
Recreation
Local Information
Science
Society
Sports
Technology

support us

Get MemeStreams Stuff!


 
Perl ISO 8601 T Separated Formatting Code
Topic: Technology 2:35 am EST, Dec 27, 2008

# And then some bloat because I happen to like the ISO 8601 time
# format.

sub time2iso (;$)
{
my $time = shift;
$time = time unless defined $time;
my($sec,$min,$hour,$mday,$mon,$year) = localtime($time);
sprintf("%04d-%02d-%02dT%02d:%02d:%02d",
$year+1900, $mon+1, $mday, $hour, $min, $sec);
}

Perl ISO 8601 T Separated Formatting Code



 
 
Powered By Industrial Memetics
RSS2.0