Java Date Format Example

You can format date in many ways. In this tutorial Format class is used to format the java date in to the different formats. This class is of java.text.Format package in java.
You can use the Format class in the following ways.

1. Create an object of Format class.
2. Set The required date format as
3. Now Create the Date class object.
4. Get The Formatted date String of you date as

Mohammed
December 8, 2011
Format of time
How can I format current date in this format 2012-12-07T15:20:32+04:00?
I have tried SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"), but I get
2012-12-07T15:20:32+0400. Note, there is no column in +0400.
Please help.