sciuriware
asked on
How to control the environmental format of SimpleDateFormat
Hi,
I'm using SimpleDateFormat in this way wherever I 'go':
/**
* Returns the <b>given</b> date formatted as <b>dd-MMM-yyyy</b> (day-month-year).
*
* @param d the date to be formatted.
* @return the formatted result as a String.
*/
public static String getDate(Date d)
{
return(new SimpleDateFormat("dd-MMM-y yyy").form at(d));
}
However, on certain machines this gives "19-Oct-2004" (what I prefer),
on other machines "19-okt-2004" or worse, due to international settings.
For various reasons I want to standardise on the 'English' format.
How do I force these things?
;JOOP!
I'm using SimpleDateFormat in this way wherever I 'go':
/**
* Returns the <b>given</b> date formatted as <b>dd-MMM-yyyy</b> (day-month-year).
*
* @param d the date to be formatted.
* @return the formatted result as a String.
*/
public static String getDate(Date d)
{
return(new SimpleDateFormat("dd-MMM-y
}
However, on certain machines this gives "19-Oct-2004" (what I prefer),
on other machines "19-okt-2004" or worse, due to international settings.
For various reasons I want to standardise on the 'English' format.
How do I force these things?
;JOOP!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:)
ASKER
Do you ever sleep?
:>)