Java Utililty Methods SQL Time Calculate

List of utility methods to do SQL Time Calculate

Description

The list of methods to do SQL Time Calculate are organized into topic(s).

Method

intgetMonth(String dateTime)
get Month
Calendar c = Calendar.getInstance();
c.setTime(getDateTime(dateTime));
int month = c.get(2) + 1;
return month;
intgetMonth(String dateTime)
get Month
Calendar c = Calendar.getInstance();
c.setTime(getDateTime(dateTime));
int month = c.get(c.MONTH) + 1;
return month;
ListgetNewFileList(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());
...
StringgetNextDateTimeStr(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);
TimegetNurseCoverageEndTime(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;
StringgetPreviousDateTimeString(String format)
get Previous Date Time String
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -1);
return toDateTimeString(calendar, format);