List of utility methods to do SQL Date Create
String | getDateAsString(int month, int date, int year) get Date As String StringBuffer dateAsString = new StringBuffer(); if (month > 9) { dateAsString.append(month); } else { dateAsString.append("0" + month); dateAsString.append(DISPLAY_DATE_DELIMITER); if (date > 9) { ... |
String | getDateFormat() get Date Format return DATE_FORMAT;
|
String | getDateFormat(java.util.Date date) getting a date string like 'yyyy-MM-dd' from a java.util.Date or java.sql.Date return getFormat(date, DATE_FORMAT_STR);
|
String | getDateString(String date) get Date String if (date != null && date.length() > 10) date = date.substring(0, 10); return date; |
String | getDateString(String pattern) get Date String Timestamp time = getSysDate(); DateFormat dfmt = new SimpleDateFormat(pattern); java.util.Date date = time; return dfmt.format(date); |
String | getDateString2() get Date String String format = "yyyy/MM/dd"; return getDateTimeString(format); |
Integer | getDay(Date date) get Day return initCalendar(date).get(Calendar.DAY_OF_MONTH);
|
int | getDay(final java.sql.Date date) Returns the day of the month for the given date Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.DAY_OF_MONTH);
|
String | getDay(String stringDate) get Day String day = ""; int checkyear = -1; if (stringDate.trim().equals("")) { return ""; } else { int index = stringDate.indexOf("-"); int lastIndex = stringDate.lastIndexOf("-"); day = stringDate.substring(lastIndex + 1, lastIndex + 3); ... |
Date | getDayByMonthSeed(Date date, int monthSeed) get Day By Month Seed Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.MONTH, monthSeed); String dstr = toDateString(calendar.getTime()); return Timestamp.valueOf(dstr + " 00:00:00"); |