4

I want to convert the date format to YYYY-MM-DDThh:mm:ss.SSSXXXZ (ISO 8601).

Getting 2021-02-10T04:02:55.55SXXXZ and it's wrong. I need it as 2021-02-10T04:02:55.55S000000Z.

select to_char(now(), 'YYYY-MM-DDThh:mm:ss.SSSXXXZ')
Jithesh Nair
  • 131
  • 1
  • 4
  • 11

1 Answers1

5

For ISO 8601 date format you can use below query:

select to_char(now(), 'YYYY-MM-DD"T"HH24:MI:SS"Z"')

Output: "2021-02-10T12:09:17Z"

Is it your desired format?