Java Calendar to String returns wrong date -


i have calendar instance returned webservice stub following date: 0001-12-31

but when use gettime() method becomes: 0002-01-02

first thought caused formatter returned date instance wrong.

can explain why?

if (cal != null) {         system.out.println(cal.tostring());         dateformat sqlformat = new simpledateformat("yyyymmdd");         sqlformat.settimezone(cal.gettimezone());           string formatted = sqlformat.format(cal.gettime());         system.out.println(formatted);         return formatted;     } 


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -