javascript - moment.js get yesterday time range from midnight to midnight -
how can time range yesterday midnight until midnight:
example:
yesterday 22.07.2015
result:
22.07.2015 00:00:00 (am)
22.07.2015 23:59:59 (pm)
date format doesn't matter example.
moment().subtract(1,'days').startof('day').tostring()
"thu jul 30 2015 00:00:00 gmt-0600"
moment().subtract(1,'days').endof('day').tostring()
"thu jul 30 2015 23:59:59 gmt-0600"
Comments
Post a Comment