A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Mobile
»
Java Micro Edition
Author
System time problem
Swastik Dey
Ranch Hand
Joined: Jan 08, 2009
Posts: 1190
I like...
posted
Apr 08, 2009 05:39:12
0
I have the following code to retrieve the current system time
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.
Swastik
a
Greenhorn
Joined: Jun 05, 2002
Posts: 2
posted
Apr 09, 2009 01:33:59
0
.
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8434
I like...
posted
Apr 09, 2009 02:42:45
0
" a " please check your private messages for an important administrative matter.
[
Donate a pint, save a life!
] [
How to ask questions
] [
Onff-turn it on!
]
I agree. Here's the link:
http://aspose.com/file-tools
subject: System time problem
Similar Threads
Using java.util.Calendar
Current time
J2ME accurate current time
Date/Time Retrieval
Servlet Filter - Reading Request Error
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter