Re: Defaut timezone

2004-08-26 Thread Dave Rolsky
On Wed, 25 Aug 2004, Kaare Rasmussen wrote:

 I can't seem to find a way to set a default timezone for all new DateTime
 objects.
 There's a class method for setting the default locale, but no method for
 setting the Timezone. Did I miss it, or is there no way to set the default
 timezone ?

There is no way to that, and it's intentional.  Setting this would almost
undoubtedly break CPAN modules which use DateTime internally.


-dave

/*===
House Absolute Consulting
www.houseabsolute.com
===*/


Re: DateTime::Format::Epoch::ActiveDirectory

2004-08-26 Thread Eugene van der Pijll
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


Re: DateTime::Format::Epoch::ActiveDirectory

2004-08-26 Thread Eugene van der Pijll
Andrew Sterling Hanenkamp schreef:
 my $ad_date_format = DateTime::Format::Epoch-new(
 epoch = $epoch, unit = 1e7, type = 'bigint', skip_leap_seconds 
 = 1,
 local_epoch = undef);

Just a small question: are you sure that the Active Directory count is
in UTC? The DotNet count is in local time, and the module
OLE::Storage::Lite also converts these values to local time.

Eugene