Hi, I use prisma postgres date db type. Can this ...
# orm-help
t
Hi, I use prisma postgres date db type. Can this set date record base on local timezone date. My timezone UTC+9:00, so in my client nodejs,
prisma.some_table.create({ date_column: new Date(2021,9,1) })
may interpret 2021-08-31T150000.000Z as UTC to 2021-08-31T000000.000Z so, the result it saves 2021-08-31 as the date. It is ideal if prisma orm accept date.toLocaleString() as date type record value, but it doesn’t. For codebase clean as possible, I don’t want to rely on add offset base solutions. Is there any idea?
1
Copy code
Finally I decided to this data to int yyyymmdd value, since date type can't be representative of date  without timezone because UTC 00:00:00 have diff 1 day and can't avoid without offset if I use minus offset time.
If we ready 1 db / 1 region int data is enough to query over month.