• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

midlet current time problem

 
Vaneet Sharma
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone tell me why i cannot get the localised time in my midlet

check this code and tell me why i cannot get the Local time on my midlet

public void addDateTime() {

//Getting Timezone
TimeZone timezone = TimeZone.getTimeZone("GMT+01:00");
//Calendar c = Calendar.getInstance(timezone);

//Creating today's time
currentTime = new Date();
System.out.println("Date objec: " + currentTime.getTime());

//puting timezone object in DateField constructor
dateTimeAlert = new DateField("Use Format Defined", DateField.DATE_TIME,timezone);
dateTimeAlert.setDate(currentTime);

//adding date to the form
this.append(dateTimeAlert);

this.addCommand(setTimer);
this.addCommand(resetTimer);
this.addCommand(exit);

}

any help will be appreciated
Thankx
Vaneet
--------------------

Vaneet
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic