Skip to content

Tag: date-format

java format particular date with T character

What is the correct form for parse this date?: 2015-05-29T00:00:00+02:00 Answer Try with Notice that MM represents months, while mm represents minutes. if you want to have 24h format use HH, hh is for 12h format XXX represents time zone in format like -08:00 to add literal like T in format you need to surroun…

dd/mm/yyyy vs dd/MM/yyyy?

Result is todays date i.e 23/03/2014 But when i do result can be 23/05/2014, 23/05/2014, 23/06/2014 and son with each run of prgram. Why so? Answer It’s because mm is for minutes, not months. More in the documentation.

Java date format – including additional characters

Is there an equivalent to php date() style formatting in Java? I mean, in php I can backslash-escape characters to have them treated literally. I.e. yyyy year would become 2010 year. I did not find anything similar in Java, all examples deal only with built-in date formats. In particular, I deal with JCalenda…