Take the 2-minute tour ×

I want to get local date format. I mean I want that method (or list of methods) which would return String which would be yyyy-MM-dd, if it is LT; yyyy/MM/dd if it is EN and so on. I don't need exact numbers like 2001/02/26, but only format. How can I get that?

share|improve this question
DateUtils will format time/date suitably in most cases. –  Jens May 7 '12 at 14:04
add comment

1 Answer

up vote 1 down vote accepted

The class SimpleDateFormat contains a method toPattern that might be useful to you. Your question is similar to the one in Getting pattern string from java SimpleDateFormat, where there is more information.

share|improve this answer
add comment

Your Answer


