Esempio n. 1
0
 public static int getCurrentDateInt() {
   Calendar cal = Calendar.getInstance();
   return Integer.valueOf(
       Common.checkDigit(cal.get(Calendar.YEAR))
           + Common.checkDigit(cal.get(Calendar.MONTH))
           + Common.checkDigit(cal.get(Calendar.DATE)));
 }
Esempio n. 2
0
 public static String getCurrentDate() {
   Calendar cal = Calendar.getInstance();
   return cal.get(Calendar.YEAR)
       + "/"
       + Common.checkDigit(cal.get(Calendar.MONTH))
       + "/"
       + Common.checkDigit(cal.get(Calendar.DAY_OF_MONTH));
 }
Esempio n. 3
0
 public static String getCurrentTime() {
   String currentTime = "PM";
   Calendar cal = Calendar.getInstance();
   if (cal.get(Calendar.AM_PM) == Calendar.AM) currentTime = "AM";
   return Common.checkDigit(cal.get(Calendar.HOUR))
       + ":"
       + Common.checkDigit(cal.get(Calendar.MINUTE))
       + " "
       + currentTime;
 }