in reply to From a date to epoch seconds
You want DateTime::Format::Strptime.
#!/usr/bin/perl use strict; use warnings; use DateTime::Format::Strptime; my $date = '2005 322'; # 322nd day of 2005 my $p = DateTime::Format::Strptime->new(pattern => '%Y %j'); my $dt = $p->parse_datetime($date); print $dt->epoch, "\n", $dt->dmy, "\n";
Oh, and by the way, what you have there is not really a Julian Day.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|