List of utility methods to do Date Now
String | getCurrentDateTimeForShow() get Current Date Time For Show return showDateFormat.format(new Date()); |
String | getCurrentDateTimeISO8601() get Current Date Time ISO DecimalFormat df = new DecimalFormat("00"); Calendar calendar = GregorianCalendar.getInstance(); int hour = calendar.get(Calendar.AM_PM) == Calendar.AM ? calendar.get(Calendar.HOUR) : calendar.get(Calendar.HOUR) + 12; return (new Integer(calendar.get(Calendar.YEAR))).toString() + "-" + df.format(calendar.get(Calendar.MONTH) + 1) + "-" + df.format(calendar.get(Calendar.DATE)) + " " + df.format(hour) + ":" + df.format(calendar.get(Calendar.MINUTE)) + ":" + df.format(calendar.get(Calendar.SECOND)); ... |
Date | getCurrentDateTimeObj(String dateTime, String format) get Current Date Time Obj SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.parse(dateTime); |
String | getCurrentDateTimeString() get Current Date Time String Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.setTimeZone(TimeZone.getTimeZone("UTC")); return getDefaultFormatedDate(calendar.getTime().getTime()); |
String | getCurrentDateTimeString(String returnFormat) get Current Date Time String DateFormat dateFormat = new SimpleDateFormat(returnFormat); Date date = new Date(); String dateString = dateFormat.format(date); dateString = dateString.replace("/", ""); dateString = dateString.replace(" ", ""); dateString = dateString.replace(":", ""); dateString = dateString.replace(".", ""); return dateString; ... |
String | getCurrentDateTimeStringValue() Gets current Time in xsd:dateTime format. Calendar cal = Calendar.getInstance(); Date thisDate = cal.getTime(); SimpleDateFormat formatterDate = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat formatterTime = new SimpleDateFormat("HH:mm:ss"); String currDate = formatterDate.format(thisDate) + "T" + formatterTime.format(thisDate); return currDate; |
String | getCurrentDateToString(String pattern) add by zhaoliguo format current date to string by input pattern Date date = new Date(); return getDateToString(date, pattern); |
String | getCurrentDateWithDot() get Current Date With Dot java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat("yyyy.MM.dd", java.util.Locale.KOREA); return dateFormat.format(new java.util.Date()); |
String | getCurrentDay() get Current Day java.util.Date NowDate = new java.util.Date(); SimpleDateFormat formatter = new SimpleDateFormat("dd"); return formatter.format(NowDate); |
String | getCurrentDay() Method: get current day[year-month-day] type string return formatCurrentTime(YEAR_MONTH_DAY);
|