How can I cast this string date to datetime in oracle.
Sun Apr 21 21:32:13 IRDT 2013
"IRDT" is the time zone and its equal in all records.
How can I cast this string date to datetime in oracle.
Sun Apr 21 21:32:13 IRDT 2013
"IRDT" is the time zone and its equal in all records.
If you don't care about timezone and it is equal in all records you can try
SELECT TO_DATE('Sun Apr 21 21:32:13 IRDT 2013'
,'DY MON DD HH24:MI:SS "IRDT" YYYY') "date"
FROM dual;
Output:
| DATE |
--------------------------------
| April, 21 2013 21:32:13+0000 |
But if you need to take into account and store timezone info then you might want to use TIMESTAMP WITH TIME ZONE
data type and TO_TIMESTAMP_TZ()
Use this : http://www.techonthenet.com/oracle/functions/to_date.php
Basically you would use to_Date('Sun Apr 21 21:32:13 IRDT 2013','mask'), and you create the mask string using the table from that link