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

Docu improvement: Time unit relevance in Date module #538

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@jvoigtlaender
Contributor

jvoigtlaender commented Mar 25, 2016

The current problem is that the link http://en.wikipedia.org/wiki/Unix_time is explicitly saying that Unix time is in seconds. So users of Date.toTime are currently tempted to read the resulting value as "time in seconds since epoch". But actually due to the way Elm deals with time, this is wrong. Instead of Date.toTime someDate, they would have to do Time.inSeconds (Date.toTime someDate) to interpret stuff correctly. Conversely, the documentation of Date.fromTime currently suggests that one can pass a "seconds since epoch" (aka "UNIX time") value and get a meaningful result. But that's not the case, Date.fromTime 646137900 will not do what's expected.

The documentation additions here aim to prevent those confusions.

capitalization of "Unix"
... to be consistent with how it's spelled in the link

evancz pushed a commit that referenced this pull request Apr 28, 2016

@evancz evancz closed this Apr 28, 2016

@evancz evancz deleted the jvoigtlaender-patch-7 branch Apr 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment