import java.text.*; //SimpleDateFormat
import java.util.*; //Date
class MyClass
{
public static void main (String[] args)
{
SimpleDateFormat sdt = new SimpleDateFormat ("d-y-M");
Date today = new Date();
String msg = sdt.format(today);
System.out.println(msg);
}
}
This code gives output : “31-2012-12”..
but I want as below :
“Thirty One – Two thousand twelve – Twelve”..
Adding my comment as an asnwer:
You may convert it to a number then use this post as a reference: How to convert number to words in java to convert numbers to words.