In Sails ORM/ODM Waterline there 3 date types: date, time and datetime. In my model I have type:'date'
. But when i tried to save date like YYYY-MM-DD
, it saved it like YYYY-MM-(DD-1)T22:00:00Z
(UTC).
Database: postgreSQL
How to keep only date, without time and timezone conversion?
Of course i can keep it as string
type. But in this case i wouldn't be able to search date in range.
Update 1: This is part of my model.
id: {type: "Integer", autoIncrement: true, primaryKey: true},
name: {type: "string", required: true,},
description: {type: "text", required: false,},
type: {type: 'string'},
startDate: {type: "date",},
endDate: {type: "date",},
episodes: {type: "Integer", required: false,}
This is inside of script "Create ..."
id serial NOT NULL,
name text,
description text,
type text,
"startDate" date,
"endDate" date,
episodes integer,
"createdAt" timestamp with time zone,
"updatedAt" timestamp with time zone,
I don't need fields created and updated either(which auto added to every table), but this might somewhere disables in config