List of utility methods to do SQL Date Create
Object | getLastDayOfPreviousMonth(Date date, boolean isFormatDate) get Last Day Of Previous Month Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.MONDAY, calendar.get(Calendar.MONTH) - 1); calendar.set(Calendar.HOUR_OF_DAY, 23); calendar.set(Calendar.MINUTE, 59); calendar.set(Calendar.SECOND, 59); if (isFormatDate) return formatDate(getLastDayOfMonth(calendar.getTime())); ... |
Calendar | getLastSundayDate() Gets the last sunday date. Calendar cal = Calendar.getInstance(); int daydiff = cal.get(Calendar.DAY_OF_WEEK) - Calendar.SUNDAY; cal.add(Calendar.DATE, daydiff * -1); return cal; |
Long | getLongDate(String strDate) get Long Date Date date = java.sql.Date.valueOf(strDate); Long lDate = new Long(date.getTime()); return (lDate); |
java.sql.Timestamp | getSqlCurrentDate() Get the current timestamp in SQL timestamp java.util.Date today = new java.util.Date(); return new java.sql.Timestamp(today.getTime()); |
java.sql.Date | getSqlCurrentDate() get Sql Current Date SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); java.util.Date d = sdf.parse(sdf.format(new java.util.Date())); return new java.sql.Date(d.getTime()); |
java.sql.Date | getSqlDate() get Sql Date return new java.sql.Date(getTime()); |
java.sql.Date | getSQLDate() Method getSQLDate. Calendar caldate = Calendar.getInstance(); int day = caldate.get(Calendar.DATE); int month = caldate.get(Calendar.MONTH); int year = caldate.get(Calendar.YEAR); java.sql.Date sqldate = getSQLDate(year, month, day); return sqldate; |
java.sql.Date | getSqlDate() get Sql Date return new java.sql.Date(getTime()); |
java.sql.Date | GetSqlDate() Get Sql Date Date cDate = new Date(); return new java.sql.Date(cDate.getTime()); |
Date | getSysDate() get Sys Date return new Date(Calendar.getInstance().getTime().getTime()); |