date-format icon indicating copy to clipboard operation
date-format copied to clipboard

format is misscalculating day?

Open farebord opened this issue 5 years ago • 0 comments

Hey, I'm trying to convert some time in seconds to string using format. My current approach is working but its showing the wrong amount of days.

DateFormat.format
        [ DateFormat.dayOfYearNumber
        , DateFormat.text "D "
        , DateFormat.hourMilitaryNumber
        , DateFormat.text "H "
        , DateFormat.minuteNumber
        , DateFormat.text "M "
        , DateFormat.secondNumber
        , DateFormat.text "S"
        ]
        utc
        (Time.millisToPosix (someTimeInSeconds * 1000))

When I try this with someTimeInSeconds = 807627. It will return 10 days instead of 9.

farebord avatar Dec 02 '19 01:12 farebord