1

I have a date: 'Fri Jul 24 13:11:04 CEST 2015'. How can I convert this string to a date? Ultimately I would like to do something like that:

to_char('Fri Jul 24 13:11:04 CEST 2015', 'DD/MM/YYYY HH24:MI:SS')

I tried approaches but all failed so far with this error:

ORA-01858:  -  "a non-numeric character was found where a numeric was expected"
*Cause:    The input data to be converted using a date format model was
           incorrect.  The input data did not contain a number where a number was
           required by the format model.
*Action:   Fix the input data or the date format model to make sure the
           elements match in number and type.  Then retry the operation.

Would it even be possible for me to do what I want here?

kaligne
  • 3,098
  • 9
  • 34
  • 60

1 Answers1

1

You need to use to_date:

to_date('Fri Jul 24 13:11:04 CEST 2015', 'DD/MM/YYYY HH24:MI:SS')

http://ss64.com/ora/syntax-to_date.html

to_char is expecting numbers only

http://ss64.com/ora/syntax-to_char.html