1

I'm creating a CSV file from my application, using oracle. When I open the csv file created, the columns which include dates are formatted in a special format such as dd-mmm-yy and not dd/mm/yyyy which is what I was expecting.

What can be the reason for that and what can I do to prevent it from happening?

1
  • just a hunch: could it have to do with the locale setting of the machine? Commented Dec 27, 2011 at 10:22

2 Answers 2

1

The reason is the default date format in NLS_DATE_FORMAT. It can be set in a lot of places: sql session (in a logon trigger), os variable, registry, pfile. Or it can be derived from settings like NLS_TERRITORY wich can be explicitly set or derived from the locale setting on the client.

SQL>alter session set NLS_DATE_FORMAT='DD/MM/YYYY';
SQL>[select csv statements;]

Probably will do the trick

Sign up to request clarification or add additional context in comments.

Comments

0

use TO_CHAR(date, 'format') function on your column where the format is dd/mm/yyyyy

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.