-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timestamp columns and Date values #34
Comments
I've resorted to doing this, for now. export function pgDate(timestamptz: string) {
const tszRegex = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}$/;
const patched = tszRegex.test(timestamptz) ? `${timestamptz}Z` : timestamptz;
return new Date(patched).toISOString();
}
pgDate("2023-11-24 01:35:27.658") // "2023-11-24T01:35:27.658Z" |
Honestly, after looking at |
Here's my shameful hack to get around the issue:
|
About this they are also converting type "date" values into JS dates, so we are saving values with timestamps into date type columns. In postgres date columns should be in this format: 'yyyy-mm-dd'. So this PR solves the issue partially, only for timestamps. But not for dates |
We need this fix: a2c26d4Edit: The fix is not correct for Postgres timestamp columns. Implied UTC needs to be added.
The text was updated successfully, but these errors were encountered: