On Thu, 16 Jan 2003 00:42:16 -0600 (CST), [EMAIL PROTECTED] wrote:
>On Tue, 14 Jan 2003, Martijn van Beers wrote:
>>
>> Floating time *still* has a timezone. It is just variable. But, since
>> your computer can be in only one spot, it is never ambiguous which
>> timezone it is in. The only time you need this floating timezone is
>> when storing your date (to disk, in a VEVENT, whatever).

?? If you intend a date-time to be floating, any manipulation you do
to it should assume it is floating, not local.  For instance, if there
are separate methods to format a date as utc or as local, both should
come out the same, whether or not it is stored.

>> So Date::ICal doesn't really do anything wrong, it just could be a bit
>> more friendly about it. Like remembering if this was entered as a
>> floating time.

That's what I meant.  To work with a floating time, you need a Date::ICal
object and another indicator of whether it is floating :(.

>How would you handle leap seconds with floating time?  Particularly how do
>you handle leap seconds in a case like this:
>
>  my $dt = DateTime->new( year => 1997, month => 6, day => 30,
>                          hour => 23, minute => 59, second => 59,
>                          ( timezone => $utc_zone ) ... or ...
>                          ( timezone => $other_zone ) ... or ...
>                          ( floating => 1 ) ... or ...
>                        );
>
>  $dt += DateTime::Duration->new( seconds => 2 );
>
>What is $dt now?
>
>If it were UTC, the time would be "1997-07-01 00:00:00", right?  If it
>were some other time zone the time would be "1997-07-01 00:00:01".  But if
>its floating, how do you decide?

I think you assume no leap second, so it would be "1997-07-01 00:00:01".

Interestingly, Olsen has support for leap seconds occurring either at
midnight UTC ("Stationary") or at midnight for each time zone ("Rolling").
But only the UTC variety are entered in their table.  They also have
support for double leap seconds and one or two removed seconds so that
a minute could be anywhere from 58-62 seconds long.

Reply via email to