Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vnext-nguyen-quyen/00dcebebfc0feda095eedba9dedaf1a0 to your computer and use it in GitHub Desktop.
Save vnext-nguyen-quyen/00dcebebfc0feda095eedba9dedaf1a0 to your computer and use it in GitHub Desktop.
PosgreSQL note statement
1. Convert timestamp to microsecond bigint:
SELECT EXTRACT(EPOCH FROM to_timestamp('20210311 09','yyyymmdd TZH'))::bigint
2. Covnert string to timestampt with timemodified timezone +9:
to_timestamp(timemodified) >= to_timestamp(''20210309000000 09'',''yyyymmddhh24miss TZH'')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment