PL/SQL date & time formatting

Status
Not open for further replies.

pazuzu

Ars Tribunus Militum
2,702
Does anyone know how to format the timestamp output from Oracle's PL/SQL into the default "date" output on Solaris?

"date" defaults to "date +'%a %b %e %T %Z %Y'", as seen in the sample output below:
Thu Nov 17 23:24:23 GMT 2011

I've tried various

# this is still missing the timezone and weekday parts
alter session set nls_date_format='Mon DD hh24:mi:ss YYYY';

# this is missing the weekday, and returns "ERROR: ORA-01821: date format not recognized"
alter session set nls_timestamp_format='MON DD HH24:MI:SS TZR YYYY';
 
Status
Not open for further replies.