Re: convert to/from .NET's System.DateTime?

2003-11-24 Thread Dave Rolsky
On Sun, 23 Nov 2003, Joshua Hoblitt wrote:

 On Sun, 23 Nov 2003, Dave Rolsky wrote:

  This should be relatively simple to do, but I'm sure the current API makes
  it easy.  Basically, it'd be something like:
 
(86400 * (Rata Die days) + (seconds) + (leap seconds so far)) * 10_000_000
 
  Getting that last bit of information can be done via the
  DateTime::LeapSecond package distributed with DateTime.pm, but DateTime.pm
  internally gets this information from a quicker XS implementation.
 
  I suppose I could add a method for this if there's a need.

 This should be a format module.  Something like DateTime::Format::DotNet.

Yeah, I agree.  I was just saying that if people wanted to be able to ask
how many leap seconds a particular datetime object included, I could add a
method for that.


-dave

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


Re: convert to/from .NET's System.DateTime?

2003-11-24 Thread Eugene van der Pijll
Eugene van der Pijll schreef:
 
 use DateTime::Format::Epoch::DotNet;
 
 my $formatter = DateTime::Format::Epoch::DotNet-new();
 
 my $dt2 = DateTime-new( year = 100, month = 1, day = 1 );
 print $formatter-format_datetime( $dt2 ), \n;

I've just released DT::F::Epoch v0.06. This now works.

 Do you know if leap seconds are included in this count? (Or: can you
 give an example of a ticks value in the year 2003, for example?)

I've assumed that leap seconds are skipped, as the specification of the
.NET datetime type allows the values 0 to 59 for the seconds. (Are we
the only ones who can get this right?)

Eugene