Results 1 to 1 of 1
Thread: System time problem
- 04-08-2009, 01:36 PM #1
Senior Member
- Join Date
- Dec 2008
- Location
- Kolkata
- Posts
- 280
- Rep Power
- 5
System time problem
I have the following code to retrieve the current system time
The code works fine on all devices except on windows mobile with Esmertec Jbed platform, where I am getting a completely wrong time.Java 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(); }
Any help in this regard will be highly appreciated.
Similar Threads
-
setting system clocks time
By pks in forum New To JavaReplies: 4Last Post: 05-14-2009, 03:36 AM -
Date n Time Display problem
By kapilverma32 in forum Advanced JavaReplies: 6Last Post: 02-10-2009, 01:53 PM -
set system time
By @eddie.com in forum New To JavaReplies: 3Last Post: 09-02-2008, 03:55 PM -
Time-Date problem
By teo.danciu in forum New To JavaReplies: 5Last Post: 08-27-2008, 10:01 AM -
Urgent-Imp-Displaying message with respect to system time
By garinapavan in forum New To JavaReplies: 1Last Post: 08-03-2007, 02:17 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks