Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails unless TZ=America/Los_Angeles (0.01_02-TRIAL) #6

Closed
eserte opened this issue May 22, 2016 · 3 comments
Closed

Fails unless TZ=America/Los_Angeles (0.01_02-TRIAL) #6

eserte opened this issue May 22, 2016 · 3 comments

Comments

@eserte
Copy link

eserte commented May 22, 2016

t/format.t fails for most timezones. E.g. for TZ=UTC:

#   Failed test 'strftime format: %s'
#   at t/format.t line 26.
#          got: '981173106'
#     expected: '981201906'
# Looks like you failed 1 test of 4.
t/format.t .............
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/4 subtests
@barefootcoder
Copy link
Owner

Man, I hate timezones. :-/

Okay, this one is caused by two things. First, I forgot to force my test datetime to UTC. But, secondly, that doesn't fix it, because there is a weirdness on the Time::Piece side (see Dual-Life/Time-Piece#24).

So I think the right answer is to do the workaround I suggest for Time::Piece in that issue here in Date::Easy. That way we'll always get the right answer regardless of what Time::Piece does about %s.

Thx for another clear error report. I'll try to put together a fix for this tomorrow.

barefootcoder added a commit that referenced this issue May 26, 2016
primary fix was to make the datetime UTC
however, this exposed an oddity (maybe a bug?) in Time::Piece:
-	see Dual-Life/Time-Piece#24 for a full explanation
so now we have our own `strftime` implementation which is not just a pass-through
-	now, for us, `->strftime("%s")` is always equivalent to `->epoch`
(note that my use of look-behind means you have to have at least Perl 5.005)
(but that doesn't seem like too much of a hardship)
@barefootcoder
Copy link
Owner

Fixed. Will close once CPAN Testers verifies.

@barefootcoder
Copy link
Owner

Should be fixed in 0.02.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants