TimePartsTest
`Time.toHour`, `Time.toMinute` and `Time.toSecond` in `Time.utc` give 0, 0 and 0 for the Unix epoch.
Results
elm-0.19.1
passran in 35 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. hour: 0 minute: 0 second: 0
elm-0.19.2
passran in 30 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. hour: 0 minute: 0 second: 0
elm-0.19.3
passran in 36 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. hour: 0 minute: 0 second: 0
lamdera-1.5.0
passran in 38 msOutput
hour: 0 minute: 0 second: 0
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-time/TimePartsTest] in its title.
Source
The -- CHECK: lines give the expected output.
module TimePartsTest exposing (main)
{-| `Time.toHour`, `Time.toMinute` and `Time.toSecond` in `Time.utc` give 0, 0 and 0 for the Unix epoch.
-}
-- CHECK: hour: 0
-- CHECK: minute: 0
-- CHECK: second: 0
import Html exposing (text)
import Time
main =
let
posix = Time.millisToPosix 0
_ = Debug.log "hour" (Time.toHour Time.utc posix)
_ = Debug.log "minute" (Time.toMinute Time.utc posix)
_ = Debug.log "second" (Time.toSecond Time.utc posix)
in
text "done"