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

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -