Formatting ZonedDateTime for previous years

I am trying to format MM/dd/YY into uuuu-MM-dd’T00:00:00Z. I have the following code. String dateTime = “12/10/20”; DateFormat df = new SimpleDateFormat(“MM/dd/yy”); Date date; …

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

SimpleDateFormat sdf = new SimpleDateFormat(“dd/MM/yyyy”); String date = sdf.format(new Date()); System.out.println(date); Result is todays date i.e 23/03/2014 But when i do …

“Java DateFormat is not threadsafe” what does this leads to?

Everybody cautions regarding Java DateFormat not being thread safe and I understand the concept theoretically. But I’m not able to visualize what actual issues we can face due to this. Say, I’ve a …

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 …