Home > Blockchain >  correct to_char date syntax to have trailing zeroes after milliseconds
correct to_char date syntax to have trailing zeroes after milliseconds

Time:05-24

My current query in oracle sql for getting a date format is TO_CHAR(c2.start_on,'DD-MM-YY HH:MI:SS.FF PM'), it outputs the date format like this 25-11-20 07:00:13.36 PM

However I want it to display the date in this way 25-11-20 07:00:13.360000000 PM

What should I add in the date format for this to be possible ? I have tried doing it like this HH:MI:SS.FM00000 as suggested enter image description here

If you have a date, you could convert it to a TIMESTAMP (using CAST AS TIMESTAMP), but better to look at updating your data model to use the proper type for the source column as starters.

enter image description here

  • Related