dresende/node-orm2

Timestamp returned is always the same

becauseinterwebs opened this issue · 3 comments

It seems whenever I retrieve a record that has a Datetime field, the timestamp is always 05:00:00.000.

For example, when I save a record, I have a beforeCreate hook:

this.createdAt = new Date();

This will return (for example):

2017-08-03T00:06:26.396Z

But when I retrieve the record, I get:

2017-08-03T05:00:00.000Z

The time portion of the datetime is always T05:00:00.000.

Is this a setting somewhere?

dxg commented

What does your database table look like?

I just realized I did not set time to true:

date: A date object. You can specify time: true

Let me try that!

Ok, for some reason I had my datetime fields set to just DATE in the database...oops :/

Sorry about that!