Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add letter "T" between date and time using Oracle?

I want to add letter T between date and time using oracle

Like this:

2015/01/01T00:00:00

Script for date

to_char(l.date_generated, 'yyyy/mm/dd hh24:mi:ss')
like image 661
User014019 Avatar asked Nov 16 '25 18:11

User014019


1 Answers

Oracle docs:

You can include these characters in a date format model: ...Character literals, enclosed in double quotation marks

so,

TO_CHAR(l.date_generated, 'yyyy/mm/dd"T"hh24:mi:ss')
like image 142
Amadan Avatar answered Nov 18 '25 13:11

Amadan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!