Home » SQL & PL/SQL » SQL & PL/SQL » arabic date to english date (oracle 9i)
arabic date to english date [message #381873] Tue, 20 January 2009 03:12 Go to next message
syamthampiv
Messages: 16
Registered: November 2007
Junior Member
hi all,


i need to convert an arabic date to english date. how can i do it with a select statement

thanks in advance
Re: arabic date to english date [message #381880 is a reply to message #381873] Tue, 20 January 2009 03:44 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
1) An Oracle date is not Gregorian or Arabic or in any other format, an Oracle date is an internal representation in an internal format.

2) You can convert varchar2 (a formatted string) into a date with the to_date function.

3) You can convert a date into an varchar2 with the to_char function.

4) the to_date and the to_char functions can have a nls_calendar parameter.

An example for some to_chars :

select 
to_char(sysdate,'day dd month yyyy',
        'nls_calendar=''Arabic Hijrah'''),
to_char(sysdate,'day dd month yyyy',
        'nls_calendar=''English Hijrah'''),
to_char(sysdate,'day dd month yyyy',
        'nls_calendar=''gregorian''')
from dual;


Re: arabic date to english date [message #381881 is a reply to message #381873] Tue, 20 January 2009 03:49 Go to previous message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
See a couple of example at: http://www.orafaq.com/forum/m/322710/102589/?msg_322710#msg_322710

Regards
Michel
Previous Topic: how to write this query
Next Topic: file write error
Goto Forum:
  


Current Time: Sun Dec 11 08:26:28 CST 2016

Total time taken to generate the page: 0.15311 seconds