-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
questionIssues that look for answers.Issues that look for answers.
Description
- Version: v6.3.0
- Platform: Windows 7 (64bit)
- Subsystem: Node Core Runtime - Date object.
This is the code I use to get the first day and the last day of the month in the browser:
var firstDay = new Date((new Date()).getFullYear(), (new Date()).getMonth(), 1);
var lastDay = new Date((new Date()).getFullYear(), (new Date()).getMonth() + 1, 0);
console.log(firstDay);
console.log(lastDay);
The browser gives the following (correct) results:
Sat Oct 01 2016 00:00:00 GMT+0200 (Central Europe Daylight Time)
Mon Oct 31 2016 00:00:00 GMT+0100 (Central Europe Standard Time)
Yet the Node runtime gives these results:
2016-09-30T22:00:00.000Z
2016-10-30T23:00:00.000Z
Disregarding the formatting, the numerical values for month and day aren't what they are when the same code is executed in the browser.
Has anyone else noticed this?
Thanks.
Metadata
Metadata
Assignees
Labels
questionIssues that look for answers.Issues that look for answers.