List of utility methods to do Time Now
String | getThaiCurrentTime() get Thai Current Time java.text.SimpleDateFormat thaiCurrentTime = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss", new java.util.Locale("th", "TH")); System.out.println(thaiCurrentTime.format(new java.util.Date())); return thaiCurrentTime.format(new java.util.Date()); |
String | getTimeFromCurrent(long l) get Time From Current if (l == 0) return ""; return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(l)); |
String | getTimeString() Helper method that returns the date and time in a format that can be used to create filenames. return new SimpleDateFormat("MM-dd-YY_k-mm").format(Calendar.getInstance().getTime()); |
String | getTimeString() Get the current time in the default format. Date date = new Date(); return timeFormat.format(date); |
String | getTimeString() get Time String DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); Date today = Calendar.getInstance().getTime(); return df.format(today); |
String | getTimeString() get Time String return new SimpleDateFormat("HH:mm:ss").format(nowDate()); |
String | printTime() print Time return new SimpleDateFormat("HH:mm:ss").format(Calendar.getInstance().getTime()); |
void | printTime() print Time System.out.println(getTime()); |
String | printTime(Date date) print Time if (date == null) return null; DateFormat formatter = new SimpleDateFormat("HH:mm:ss"); DateFormat tzFormatter = new SimpleDateFormat("Z"); String timezone = tzFormatter.format(date); return formatter.format(date) + timezone.substring(0, 3) + ":" + timezone.substring(3); |
String | readCurrentTime() read Current Time Date dateNow = Calendar.getInstance(new SimpleTimeZone(9 * 60 * 60 * 1000, "KST")).getTime(); SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmssSSS", Locale.getDefault()); return formatter.format(dateNow); |