Dual-Life / Time-Piece

Object Oriented time objects
Other
15 stars 33 forks source link

when using strptime , c_isdst is not store; is this specification? #9

Open rozary opened 9 years ago

rozary commented 9 years ago

hi. Please teach me.

BEGIN {
  $ENV{TZ} = "WET"; #Western European Time UTC+0
}
my $t = localtime()->strptime("2015-03-29 00:00:00",'%Y-%m-%d %T' );
say $t; #Sun Mar 29 00:00:00 2015
say $t->isdst; #said 0

$t = localtime()->strptime("2015-03-29 01:00:00",'%Y-%m-%d %T' );
say $t; #Sun Mar 29 02:00:00 2015
say $t->isdst; #said 0. but, i think here is 1.

I think this case, and should be stored.

smith153 commented 8 years ago

strptime() in Time::Piece is not implemented very well, and as you can see isdst is not even set by it. Currently I am working at rewriting strptime() to use pure perl (right now it is made up of C code that was cut and pasted from another library). I do not have an estimated release date, but hopefully before perl 5.24 is released.