Skip to content

Instantly share code, notes, and snippets.

@maticzav
Created January 22, 2017 21:36
Show Gist options
  • Save maticzav/1fbe4f313416e7c0276a01e1b3708014 to your computer and use it in GitHub Desktop.
Save maticzav/1fbe4f313416e7c0276a01e1b3708014 to your computer and use it in GitHub Desktop.
Elm - get beginning of the day from epoch time
import Time exposing (Time)
-- 2017-01-22T17:18:02.921Z -> 2017-01-22T00:00:00.000Z
today : Time -> Time
today time =
time - (toFloat <| rem (round time) (round <| 24.0 * Time.hour))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment