List of utility methods to do SQL Time Calculate
int | getMonth(String dateTime) get Month Calendar c = Calendar.getInstance(); c.setTime(getDateTime(dateTime)); int month = c.get(2) + 1; return month; |
int | getMonth(String dateTime) get Month Calendar c = Calendar.getInstance(); c.setTime(getDateTime(dateTime)); int month = c.get(c.MONTH) + 1; return month; |
List | getNewFileList(String path, String mintime) get New File List List list = new ArrayList(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); Date d; d = sdf.parse(mintime); List<String> filelist = getAllFileName(path); for (String file : filelist) { File f = new File(file); Timestamp time = new Timestamp(f.lastModified()); ... |
String | getNextDateTimeStr(String format) get Next Date Time Str Calendar calendar = Calendar.getInstance(); long longDate = (calendar.getTime()).getTime() + (1000 * 60 * 60 * 24 * 1); java.util.Date date = new java.util.Date(longDate); calendar.setTime(date); return toDateTimeString(calendar.getTime(), format); |
Time | getNurseCoverageEndTime(Time startTime, Time shiftLength) get Nurse Coverage End Time String[] timeArray = { formatTime(startTime, TIME_24_HOUR_FORMAT), formatTime(shiftLength, TIME_24_HOUR_FORMAT) }; Time endTime = sumTimes(timeArray, new SimpleDateFormat(TIME_24_HOUR_FORMAT)); return endTime; |
String | getPreviousDateTimeString(String format) get Previous Date Time String Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -1);
return toDateTimeString(calendar, format);
|