Results 1 to 1 of 1
- 08-25-2009, 07:20 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 11
- Rep Power
- 0
probleam in getting phone time and date !!!
Hi , i want to get phone current time and date . i use this code , but time is not true !!! please help me , where in this code is wrong ???
Java Code:/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.util.*; import javax.microedition.lcdui.*; import javax.microedition.midlet.*; /** * @author mahdi */ public class Midlet extends MIDlet { Display display; Form form = new Form("Clock"); Calendar calendar; public void startApp() { display = Display.getDisplay(this); calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone("GTM")); form.append(" Year : " + String.valueOf(calendar.get(Calendar.YEAR )) + "\n" ); form.append(" Month : " + String.valueOf(calendar.get(Calendar.MONTH)) + "\n"); form.append(" Day : " + String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)) + "\n"); form.append(" Hour : " + String.valueOf(calendar.get(Calendar.HOUR_OF_DAY)) + "\n"); form.append(" Minute : " + String.valueOf(calendar.get(Calendar.MINUTE)) + "\n"); display.setCurrent(form); } public void pauseApp() { } public void destroyApp(boolean unconditional) { } }
Similar Threads
-
Time and Date
By Manfizy in forum New To JavaReplies: 0Last Post: 05-27-2009, 12:58 PM -
Formatting time and date
By Java Tip in forum java.langReplies: 0Last Post: 04-17-2008, 07:35 PM -
Date/Time Servlet
By Java Tip in forum Java TipReplies: 0Last Post: 01-14-2008, 09:34 AM -
Time and Date in Java
By java_fun2007 in forum New To JavaReplies: 4Last Post: 11-06-2007, 07:25 PM -
how to get the current date and time
By valery in forum New To JavaReplies: 1Last Post: 08-03-2007, 06:05 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks