0

I am getting format string not recognized.

Date we are getting from source : 2015-11-15 02:22:11.000 GMT

Can anyone help me with proper mask for this to convert in TO_DATE(date,'YYYY-MM-DD HH24:MI:SS TZR')

Need output in 15/11/2014 2:22:00 AM

Karthik
  • 1
  • 1
  • Hi Karthik, Welcome to stackoverflow, please posts your attempts to solve this question and mainly search in stack overflow for duplicate of this question. – WoodChopper Nov 15 '15 at 05:32
  • Possible duplicate of [Convert timestamp/date time from UTC to EST Oracle SQL](http://stackoverflow.com/questions/1751075/convert-timestamp-date-time-from-utc-to-est-oracle-sql) – WoodChopper Nov 15 '15 at 05:35

1 Answers1

3

I don't think you can use fractions of second or timezone region in format mask in TO_DATE function, you have to use TO_TIMESTAMP_TZ and then convert it to desired format.

SELECT TO_CHAR(TRUNC(TO_TIMESTAMP_TZ('2015-11-15 02:22:11.000 GMT', 'YYYY-MM-DD HH24:MI:SS.FF3 TZR'), 'MI'), 'DD/MM/YYYY fmHHfm:MI:SS AM') FROM DUAL
Husqvik
  • 5,669
  • 1
  • 19
  • 29