Greetings LostS,
Well, I just found a better way. As you'd expect, there's a module that does exactly this very thing:
#!/usr/bin/perl -w use strict; use Time::ParseDate; my $unix_time = parsedate('04/18/00 11:10 AM'); my $normal_time = localtime($unix_time); print "$unix_time == $normal_time\n";
The advantage here over my previous posted code is that here the date/time format is not so strict. Time::ParseDate allows for a fairly wide range of date/time formats. It'll also do all the conversion for you.
-gryphon
code('Perl') || die;
In reply to Re: Time Conversion Help
by gryphon
in thread Time Conversion Help
by LostS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |