Andrew Sterling Hanenkamp schreef:
> Just a suggestion for improvement to Eugene van der Pijll's nifty
> DateTime::Format::Epoch module. Inside of ActiveDirectory, it uses the
> same interval (100-nanos) as .NET, but the epoch base is January 1,
> 1601 UTC, rather than January 1, A.D. 1. (Microsoft has the weirdest
> standards.)
Thank you, I'll add this to the next version of the package.
> Another possible extension would be epochs covering wider intervals,
> such as days, which is a common interval in account information
> (specifically, shadow).
I've wanted to write a number of day counting modules (Julian Day, GPS
etc.), but I never considered them as special cases of DT::F::Epoch. But
of course they are!
For example:
my $jd0 = DateTime->new( year => -4713, month => 11,
day => 24, hour => 12);
my $fmt = DateTime::Format::Epoch->new(epoch => $jd0, unit => 1/86400);
is a Julian Day count (corresponding with the DateTime::jd() method).
Maybe I'll make the unit parameter in the constructor accept
DT::Duration's, so that you can specify units of 1 day or 1 week, etc.
Eugene