List of utility methods to do Now
String | now() Returns current date/time as a string return (DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(new Date())); |
String | now() now lock.lock(); try { return getDateFormat().format(new Date()); } finally { lock.unlock(); |
int | now() now return Integer.parseInt(new SimpleDateFormat("HHmmss").format(new Date())); |
String | now() now String DATE_FORMAT = "dd.MM.yyyy HH:mm:ss"; SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); Date date = new Date(); return sdf.format(date); |
String | now(String dateFormat) now Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.format(cal.getTime()); |
String | now(String dateFormat) Returns actual time and/or date in specified format. Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.format(cal.getTime()); |
String | now(String dateFormat) Trasnforms String --> Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.format(cal.getTime()); |
String | now(String dateFormat) now Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat(dateFormat); return sdf.format(cal.getTime()); |
String | now(String formatStr) now Date date = new Date(); DateFormat format = new SimpleDateFormat(formatStr); return format.format(date); |
String | now(String pattern) now DateFormat dateFormat = getFormat(pattern); return dateFormat.format(new Date()); |