in reply to Getting Epoch from year, woy and dow...
Obligatory “DateTime rocks” post:
Anyone know how to calculate the epoch from the following data? Year Week_of_Year Day_of_Week
use DateTime; my $epoch = DateTime ->new( year => 2002 ) ->add( weeks => 10, days => 4 ) ->epoch;
date of the data point being the monday for the week.
use DateTime; my $dt = DateTime ->new( year => 2002 ) ->add( weeks => 10, days => 4 ); # ... my $epoch = $dt->truncate( to => 'week' )->epoch;
Makeshifts last the longest.
|
|---|