Comments (10)
@kazu-yamamoto Any ideas? Should I add unix-time back to the expected failures list?
from stackage.
@byorgey Would you do the following sequence?
% cd tests
% ghci UnixTimeSpec.hs
> let ut = UnixTime {utSeconds = 1571502693, utMicroSeconds = 548856}
> formatUnixTime mailDateFormat ut
"Sun, 20 Oct 2019 01:31:33 +0900"
> currentTimeZone <- getCurrentTimeZone
> formatMailModel (toUTCTime ut) currentTimeZone
"Sun, 20 Oct 2019 01:31:33 +0900"
And please tell me what kinds of results are returned.
In the case above, the results are the same. So, it should pass the test.
from stackage.
*UnixTimeSpec> let ut = UnixTime {utSeconds = 1571502693, utMicroSeconds = 548856}
*UnixTimeSpec> formatUnixTime mailDateFormat ut
"Sat, 19 Oct 2019 12:31:33 -0400"
*UnixTimeSpec> currentTimeZone <- getCurrentTimeZone
*UnixTimeSpec> formatMailModel (toUTCTime ut) currentTimeZone
"Sat, 19 Oct 2019 11:31:33 -0500"
from stackage.
Which time zone is correct?
from stackage.
Oh, I see the problem. On 19 Oct 2019, Daylight Saving Time would be in effect, hence the correct time zone would be -0400 (EDT). However, currently DST is not in effect so the time zone is -0500 (EST). The time zone is date-dependent, hence it is not correct to use currentTimeZone
with arbitrary dates.
from stackage.
So, what would you suggest to solve this problem? What can I do for this?
from stackage.
The only way I know of to solve this in a completely correct way would be to use http://hackage.haskell.org/package/timezone-series and http://hackage.haskell.org/package/timezone-olson . However, that involves pulling two more packages into stackage and in any case Olson files may not even be available on every platform. I don't know if it is worth it.
from stackage.
@snoyberg Would you add unix-time to the expected failures list?
from stackage.
@kazu-yamamoto Done
from stackage.
OK, since the unix-time test failures no longer affect Stackage, I'm closing this issue. If something in unix-time still needs to be tweaked (I'm not sure based on the above conversation), let's move discussion to unix-time itself.
from stackage.
Related Issues (20)
- tasty-bench-0.4 HOT 2
- network-run-0.4 HOT 1
- comfort-glpk-0.1 test failure HOT 1
- text-rope-0.3
- hedgehog out of bounds HOT 7
- hspec-hedgehog-0.2.0.0 HOT 2
- Build cycle detected HOT 3
- fits-parse-0.4.1 HOT 1
- pandoc-3.3 HOT 1
- crypton-connection-0.4.1, hoogle-5.0.18.4 HOT 1
- envparse 0.5.2 HOT 2
- vector-space 0.19
- shakespeare 2.1.1 test failure HOT 1
- sequence-formats 1.8.1.0
- path 0.9.6
- nothunks 0.3 HOT 1
- postgresql-libpq-0.11 out of bounds for hasql-listen-notify-0.1.0.1 HOT 2
- doclayout-0.5 HOT 1
- typst-0.6
- pandoc-3.4 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stackage.