I have created DateTime.java class like this:
public class DateTime {
public String date() {
Calendar calendar = Calendar.getInstance();
return calendar.get(Calendar.DATE)+ "/" + calendar.get(Calendar.MONTH) + "/" + calendar.get(Calendar.YEAR);
}
public String time() {
Calendar calendar = Calendar.getInstance();
return calendar.get(Calendar.HOUR) + ":" + calendar.get(Calendar.MINUTE);
}
}
in all three activities I get the date and time like this:
DateTime dateTime = new DateTime();
dbHelper.insertNote(note, dateTime.date(), dateTime.time(), System.currentTimeMillis());
finish();
Is there any problem with the DateTime class implementation?