In the javadoc of java.util.Formatter I read:
'm' Month, formatted as two digits with leading zeros as necessary, i.e. 01 - 13.
Why 13?
// Setting the pattern SimpleDateFormat sm = new SimpleDateFormat("mm-dd-yyyy"); // myDate is the java. util. Date in yyyy-mm-dd format // Converting it into String using formatter String strDate = sm. format(myDate); //Converting the String back to java.
Deprecated. NOT IMPLEMENTED - use SimpleDateFormat for parsing instead.
The T is just a literal to separate the date from the time, and the Z means “zero hour offset” also known as “Zulu time” (UTC). If your strings always have a “Z” you can use: SimpleDateFormat format = new SimpleDateFormat( “yyyy-MM-dd'T'HH:mm:ss).
Javadoc explains why..
'm' '\u006d' Month, formatted as two digits with leading zeros as necessary, i.e. 01 - 13, where "01" is the first month of the year and ("13" is a special value required to support lunar calendars).
'm' Month, formatted as two digits with leading zeros as necessary,
i.e. 01 - 13, where "01" is the first month of the year and ("13" is a special
value required to support lunar calendars).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With