How to get start and end of day in Javascript?

How to get start ( 00:00:00 ) and end ( 23:59:59 ) of today in timestamp ( GMT )? Computer use a local time.


var start = new Date();

var end = new Date();

alert( start.toUTCString() + ':' + end.toUTCString() );

If you need to get the UTC time from those, you can use UTC().

Leave a Reply

Your email address will not be published. Required fields are marked *