I have a problem formatting a date. I want the following output:
yyyy-MM-ddTHH:mm:ss+02:00
Where +02:00
depends on the timezone where you are, in my case Europe/Amsterdam
I have this function:
public String marshal(Date d) throws Exception
{
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
String s = formatter.format(d);
return s;
}
But it gives me:
2017-05-10T14:56:46+0200
How can I have the timezone hour/minute with an extra colon in between?