I want to format the time as follows: 2011-05-11 11:22:33 .
I had the following code:
Time time = new Time(MobiSageUtility.TIMEZONE_STRING); time.setToNow(); String timeStr= time.format("yyyy-MM-dd HH:mm:ss");
However, this gives a date like: "yyyy-MM-dd HH:mm:ss" not "2011-05-11 11:22:33" . Looking at the Android help docs, I tried the following code:
String timeStr = time.format2445();
But this gives a line like: 20110511T112233 . Can someone tell me how to format time correctly?
source share