Created
August 15, 2019 13:24
-
-
Save jimkang/4e6dcc82acccafc23549b5190069ee5d to your computer and use it in GitHub Desktop.
Function that floors a date to the beginning of that day (12:00 AM or 00:00).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function floorToBeginningOfDay(date) { | |
return new Date(date.toLocaleDateString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment