Skip to content

Commit

Permalink
Add zero-padding to the output human time
Browse files Browse the repository at this point in the history
Fixes and closes elm#14
  • Loading branch information
olpeh committed Jan 11, 2019
1 parent dc3b75b commit a6997d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import Time exposing (utc, toHour, toMinute, toSecond)

toUtcString : Time.Posix -> String
toUtcString time =
String.fromInt (toHour utc time)
String.padLeft 2 '0' (String.fromInt (toHour utc time))
++ ":" ++
String.fromInt (toMinute utc time)
String.padLeft 2 '0' (String.fromInt (toMinute utc time))
++ ":" ++
String.fromInt (toSecond utc time)
String.padLeft 2 '0' (String.fromInt (toSecond utc time))
++ " (UTC)"
```

Expand Down

0 comments on commit a6997d0

Please sign in to comment.