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; …
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 surround it with single quotes ‘
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 …