Вот, пожалуйста,
public class DateAndTime extends MIDlet implements CommandListener{
private Display disp;
private Date d;
private DateField currentDate;
private Form form;
private int index;
public DateAndTime(){
form = new Form("Data and Time");
d = new Date();
currentDate = new DateField("", DateField.DATE_TIME);
currentDate.setDate(d);
}
public void startApp(){
index = form.append(currentDate);
disp = Display.getDisplay(this);
disp.setCurrent(form);
}
}
По этой ссылке вы найдете полный учебник: текущая дата-время
Надеюсь, это поможет.
Редактировать: -
попробовать что-то вроде этого:
new Date().getTime();
//------- OR
long dtMili = System.currentTimeMillis();
Date dt = new Date(dtMili);
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
cal.getTime(); //-------- This will give you the timestamp.