Skip to content

Instantly share code, notes, and snippets.

@marcojetson
Created August 30, 2017 08:44
Show Gist options
  • Save marcojetson/cbdb1468f40481a0db0f1e2f79c2da85 to your computer and use it in GitHub Desktop.
Save marcojetson/cbdb1468f40481a0db0f1e2f79c2da85 to your computer and use it in GitHub Desktop.
SELECT
TO_CHAR(NOW(), 'YYYY-MM-DD') ||
'T' ||
TO_CHAR(NOW(), 'HH:MM:SS') ||
'+' ||
LPAD(EXTRACT(timezone_h from NOW())::TEXT, 2, '0') ||
':' ||
LPAD(EXTRACT(timezone_m from NOW())::TEXT, 2, '0')
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment