1

I'm trying to format a date using the method where dd-mm-YYYY is an example date

Calendar cal = Calendar.getInstance(Locale.ENGLISH);
cal.setTimeInMillis(displayDate*1000);
String date = DateFormat.format("dd-mm-YYYY", cal).toString();

I'm looking for a list of characters I can use, similar to this in PHP, to format my date how I want. Is there a list anywhere around I can use? The format I'm after is 26th April, 2006, but a list would be good so I could bookmark it for reference later on.

2 Answers 2

4

The JavaDoc of SimpleDateFormat does contain such a list.

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

That's just what I was after, thanks :). (I'll accept in 3 mins when SO let's me)
1

Yes, it's in the javadoc for SimpleDateFormat: http://docs.oracle.com/javase/7/docs/api/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.