-
System time problem
I have the following code to retrieve the current system time
Code:
public static String getCurrentTimeAsString() {
Calendar cal = Calendar.getInstance();
StringBuffer sBuf = new StringBuffer();
int month = cal.get(Calendar.MONTH) + 1;
sBuf.append(month);
sBuf.append("-");
sBuf.append(cal.get(Calendar.DATE));
sBuf.append("-");
sBuf.append(cal.get(Calendar.YEAR));
sBuf.append(" ");
sBuf.append(cal.get(Calendar.HOUR_OF_DAY));
sBuf.append(":");
sBuf.append(cal.get(Calendar.MINUTE));
sBuf.append(":");
sBuf.append(cal.get(Calendar.SECOND));
return sBuf.toString();
}
The code works fine on all devices except on windows mobile with Esmertec Jbed platform, where I am getting a completely wrong time.
Any help in this regard will be highly appreciated.