0

I'm logging out the following....

dbResponseStub.startTime = new Date(2014,6,13);
console.log(dbResponse[0].startTime);
console.log(new moment(dbResponse[0].startTime).utc().format());

But I am getting...

Fri Jun 13 2014 00:00:00 GMT+0100 (BST)
2014-06-12T23:00:00+00:00

I'm confused because the second one is an hour behind what it should be. Obviously the BST thing that happens in the first one is causing a problem. Anyone know how to turn this off in node so that what time i say it is it will be?

Exitos
  • 29,230
  • 38
  • 123
  • 178

1 Answers1

2

Dates are given in local time.

The first one has BST in it because it is showing you the time zone, and that is the time zone the computer is configured to use.

British Summer Time is an hour ahead of Coordinated Universal Time.

If you want to stay in BST then remove .utc() so you don't convert to it.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335