Skip to content

offset_for_datetime is very slow for times in the (far) future. #42

@Abigail

Description

@Abigail

This is very fast:

my $tz = DateTime::TimeZone -> new (name => 'Europe/Amsterdam');
my $dt = DateTime:: -> from_epoch  (epoch => time);   
my $x  = $tz -> offset_for_datetime ($dt);

taking only a millisecond or so.

Making a slight change:

my $tz = DateTime::TimeZone -> new (name => 'Europe/Amsterdam');
my $dt = DateTime:: -> from_epoch  (epoch => 1800 * time);   
my $x  = $tz -> offset_for_datetime ($dt);

and the code runs more than 3 minutes before it completes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions