将以yyyy-MM-dd形式的字符串转换为Calendar对象

@param time
时间字符串
@param sep
分隔符号
@param isStart
为true表示时、分、秒、毫秒都取0，为false表示取最后一刻
430327
public static Calendar getCalendar(String time, char sep, boolean isStart) {
		Calendar cal = Calendar.getInstance();

		cal.set(Calendar.HOUR_OF_DAY, isStart ? 0 : 23);
		cal.set(Calendar.MINUTE, isStart ? 0 : 59);
		cal.set(Calendar.SECOND, isStart ? 0 : 59);
		cal.set(Calendar.MILLISECOND, isStart ? 0 : 999);

		try {
			int idx = time.indexOf(sep);

			if (idx != -1) {
				cal.set(Calendar.YEAR, Integer.parseInt(time.substring(0, idx)));
				time = time.substring(idx + 1);
				idx = time.indexOf(sep);
				if (idx != -1) {
					cal.set(Calendar.MONTH,
							Integer.parseInt(time.substring(0, idx)) - 1);
					cal.set(Calendar.DAY_OF_MONTH,
							Integer.parseInt(time.substring(idx + 1)));
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

		return cal;
	}
1184069
def _isdst(dt):
    
    if type(dt) == datetime.date:
        dt = datetime.datetime.combine(dt, datetime.datetime.min.time())
    dtc = dt.replace(year=datetime.datetime.now().year)
    if time.localtime(dtc.timestamp()).tm_isdst == 1:
        return True
    return False
457675
function Time(name, ...rest) {
    let h = (methodDescriptor)=>{
        let {key, descriptor} = methodDescriptor;

        let fn = descriptor.value;
        let timer;

        let timeStart;
        let timeEnd;
        if (console != null && typeof console.time === 'function') {
            timeStart = console.time;
            timeEnd = console.timeEnd;
        } else {
            timeStart = ()=>{
                timer = Date.now();
            };

            timeEnd = (name)=>{
                let abstime = Date.now() - timer;

                console.log(name, '：', abstime);
            };
        }

        descriptor.value = function(...args) {
            timeStart(name || key);
            let r = fn.apply(this, args);

            if (r && typeof r.then === 'function') {
                return r.then((succ)=>{
                    timeEnd(name || key);
                    return Promise.resolve(succ);
                }, (fail)=>{
                    timeEnd(name || key);
                    return Promise.reject(fail);
                });
            } else {
                timeEnd(name || key);
                return r;
            }
        };

        return {
            ...methodDescriptor,
            descriptor,
        };
    };

    if (typeof name === 'string') {
        return h;
    } else {
        let args = [name, ...rest];
        name = void(0);
        h(...args);
    }
}
786514
function makeDateStr(date, sep) {
	if (sep === undefined) sep = true;

	var year = date.getUTCFullYear().toString(),
		month = padNum(date.getUTCMonth()+1),
		day = padNum(date.getUTCDate()),
		hours = padNum(date.getUTCHours()),
		minutes = padNum(date.getUTCMinutes()),
		seconds = padNum(date.getUTCSeconds());

	if (sep) {
		return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
	} else {
		return year + month + day + hours + minutes + seconds;
	}
}
528669
@Override
  public final String toDateTimeString(final Date pDate,
    final Map<String, Object> pAddParam) throws Exception {
    return this.dateTimeFormat.format(pDate);
  }
507989
public void setTimeZone(final String s) {
      if (s == null) {
          calendar = Calendar.getInstance();
      } else {
        calendar = Calendar.getInstance(TimeZone.getTimeZone(s));
      }
  }
983400
function isSt(date, testOffset) {
      date = date || new Date();
      var offset = testOffset || date.getTimezoneOffset();
      return jsk.hasDst() && offset == jsk.invertedDst();
    }
1184604
public boolean isSameDay(Calendar calendar) {
		Calendar c1 = asCalendar();
		return (c1.get(Calendar.ERA) == calendar.get(Calendar.ERA) &&
				c1.get(Calendar.YEAR) == calendar.get(Calendar.YEAR) &&
				c1.get(Calendar.DAY_OF_YEAR) == calendar.get(Calendar.DAY_OF_YEAR));
	}
1343265
public Date setStartDate(Date time)
    {
        try   {
            this.getTable().edit();
            this.getField("StartDateTime").setData(time);
            this.getTable().set(this);
            this.getTable().seek(null);    // Read this record
        } catch (Exception ex)  {
            ex.printStackTrace();
        }
        return this.getStartDate();
    }
1103938
public static long getDayStartTime(final long time) {
        final Calendar start = Calendar.getInstance();
        start.setTimeInMillis(time);
        final int year = start.get(Calendar.YEAR);
        final int month = start.get(Calendar.MONTH);
        final int day = start.get(Calendar.DATE);
        start.set(year, month, day, 0, 0, 0);
        start.set(Calendar.MILLISECOND, 0);

        return start.getTimeInMillis();
    }
517024
function isSt(date, testOffset) {
      date = date || new Date();
      var offset = testOffset || date.getTimezoneOffset();
      return offset == jsk.invertedSt();
    }
17118
public void setStarttime(Object starttime) throws PageException {
	if (StringUtil.isEmpty(starttime)) return;
	this.starttime = DateCaster.toTime(pageContext.getTimeZone(), starttime);
    }
952034
public static boolean isToday(ReadablePartial time) {
        if (!time.isSupported(DateTimeFieldType.dayOfMonth())
            || !time.isSupported(DateTimeFieldType.monthOfYear())
            || !time.isSupported(DateTimeFieldType.year())) {
            throw new IllegalArgumentException("isToday() must be passed a ReadablePartial that supports day of " +
                "month, month of year and year.");
        }

        LocalDate localDate = time instanceof LocalDate ? (LocalDate) time : new LocalDate(time);
        return LocalDate.now().compareTo(localDate) == 0;
    }
217769
public boolean insideRange(Calendar startDate,
			       Calendar endDate) {
	// make a copy of the start time so that it is safe to modify it without
	// affecting the input parameter
	Calendar mutableStartDate = (Calendar)(startDate.clone());
	return isInRange(mutableStartDate, endDate);
    }
545017
public static boolean isCurrentTimeBetweenTowTimes(Date fromDate, Date fromTime, Date toDate, Date timeTo) {
		JKTimeObject currntTime = getCurrntTime();
		JKTimeObject fromTimeObject = new JKTimeObject();
		JKTimeObject toTimeObject = new JKTimeObject();
		if (currntTime.after(fromTimeObject.toTimeObject(fromDate, fromTime)) && currntTime.before(toTimeObject.toTimeObject(toDate, timeTo))) {
			return true;
		}
		return false;
	}
1255725
public static java.util.Date toDate(String date, String time) {
		if (date == null || time == null)
			return null;
		String month;
		String day;
		String year;
		String hour;
		String minute;
		String second;

		int dateSlash1 = date.indexOf("/");
		int dateSlash2 = date.lastIndexOf("/");

		if (dateSlash1 <= 0 || dateSlash1 == dateSlash2)
			return null;
		int timeColon1 = time.indexOf(":");
		int timeColon2 = time.lastIndexOf(":");

		if (timeColon1 <= 0)
			return null;
		month = date.substring(0, dateSlash1);
		day = date.substring(dateSlash1 + 1, dateSlash2);
		year = date.substring(dateSlash2 + 1);
		hour = time.substring(0, timeColon1);

		if (timeColon1 == timeColon2) {
			minute = time.substring(timeColon1 + 1);
			second = "0";
		} else {
			minute = time.substring(timeColon1 + 1, timeColon2);
			second = time.substring(timeColon2 + 1);
		}

		return toDate(month, day, year, hour, minute, second);
	}
1336595
public int setDateTime(java.util.Date date, boolean bDisplayOption, int moveMode)
    {
        if (date != null)
        {
            m_calendar.setTime(date);
            m_calendar.set(Calendar.YEAR, DBConstants.FIRST_YEAR);
            m_calendar.set(Calendar.MONTH, Calendar.JANUARY);
            m_calendar.set(Calendar.DATE, 1);
            date = m_calendar.getTime();
            return this.setValue(date.getTime(), bDisplayOption, moveMode);
        }
        else
            return this.setData(null, bDisplayOption, moveMode);
    }