0

In an application for public administration (formal documents, etc.), I need to change Date to full text (I don't know the English expression to say this).

For example, for an input like this (04/05/2014, with dd/MM/yyyy format) I need this output:

  • In English: Two thousand fourteen, May, fourth (maybe twenty fourteen)
  • In Spanish: cuatro de mayo de dos mil catorce

Is there anyway to do this in Java or Oracle? I dont't refer to a custom implementation, but any library (Java, joda-time, etc.) or built-in Oracle Function...

Thank you very much. Regards

yaki_nuka
  • 724
  • 4
  • 26
  • 44
  • 1
    I don't think there are any multi-language built in functions. Related question - http://stackoverflow.com/questions/3911966/how-to-convert-number-to-words-in-java – Gilbert Le Blanc May 05 '14 at 13:43
  • @gilbert-le-blanc , thank you. You put me on the way: finally I have had to make my custom methods to make the Spanish conversion. The related question you told contains very good suggestions too. Thank you – yaki_nuka May 05 '14 at 14:54

2 Answers2

1

Oracle spell it out by specifying SP in the format model.

SQL> select to_char(sysdate,'DDsp MON DAY YYYYsp') from dual;

TO_CHAR(SYSDATE,'DDSPMONDAYYYYYSP')
--------------------------------------------------------------------------------
FIVE MAY MONDAY    TWO THOUSAND FOURTEEN

And, Also like this. using SPTH

SQL> select to_char(sysdate,'DDspth MON DAY YYYYsp') from dual;

TO_CHAR(SYSDATE,'DDSPTHMONDAYYYYYSP')
--------------------------------------------------------------------------------
FIFTH MAY MONDAY    TWO THOUSAND FOURTEEN
Maheswaran Ravisankar
  • 17,652
  • 6
  • 47
  • 69
0

SimpleDateFormat: SimpleDateFormat is a concrete class for formatting and parsing dates in a locale-sensitive manner. It allows for formatting (date -> text), parsing (text -> date), and normalization.

http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

I hope it helps you

Enrique Quero
  • 582
  • 4
  • 12
  • thank you, but SimpleDateFormat only works for the month with Locale. It does not seem to convert day of month and year into text. – yaki_nuka May 05 '14 at 14:53