Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@C-l-o-u-d
Copy link
Contributor

@C-l-o-u-d C-l-o-u-d commented Oct 18, 2021

UTC was wrongly added to the timestamp with time zone (timestamptz)

i.e. result expession will be Date.parse('2004-10-19 10:23:54+04 UTC')

ref: #239 (comment)

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.573% when pulling 0a77ebb on C-l-o-u-d:patch-1 into 91efde6 on gajus:master.

@gajus
Copy link
Owner

gajus commented Oct 18, 2021

This will obviously break other timestamps.

There needs to be a test case for both timestamp variations.

@C-l-o-u-d
Copy link
Contributor Author

C-l-o-u-d commented Oct 18, 2021

this only applies to type name: 'timestamptz',

const timestampParser = (value: string | null) => {
   return value === null ? value : Date.parse(value);
   return value === null ? value : Date.parse(value + ' UTC');
 };

 export const createTimestampWithTimeZoneTypeParser = (): TypeParserType => {
  return {
    name: 'timestamptz',
    parse: timestampParser,
  };
};

others has different type name: 'timestamp',

And NicolasCaous also wrote about it in the original issue: #239 (comment) in the 'Possible Solution' section that However, timestamptz works flawlessly. (it was before this commit 1e9a484)

@gajus gajus merged commit 95db15d into gajus:master Oct 18, 2021
@gajus
Copy link
Owner

gajus commented Oct 18, 2021

Thank you

@gajus
Copy link
Owner

gajus commented Oct 18, 2021

πŸŽ‰ This PR is included in version 24.1.2 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

@gajus gajus added the released label Oct 18, 2021
@C-l-o-u-d C-l-o-u-d deleted the patch-1 branch October 18, 2021 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants