[datetime.datetime] 当前快照数据的时间戳
973618
def datetime(self):
        
        try:
            dt = self._tick_dict['datetime']
        except (KeyError, ValueError):
            return datetime.datetime.min
        else:
            if not isinstance(dt, datetime.datetime):
                if dt > 10000000000000000:  # ms
                    return convert_ms_int_to_datetime(dt)
                else:
                    return convert_int_to_datetime(dt)
            return dt
302225
def parse_value(self, value):
        """"""
        if value is None:
            return value
        if isinstance(value, datetime.time):
            return value
        return parse(value).timetz()
281883
def parse_datetime(value):
    
    if not value:
        return None
    elif isinstance(value, datetime.datetime):
        return value
    return dateutil.parser.parse(value)
1240662
def QA_util_get_order_datetime(dt):
    

    #dt= datetime.datetime.now()
    dt = datetime.datetime.strptime(str(dt)[0:19], '%Y-%m-%d %H:%M:%S')

    if QA_util_if_trade(str(dt.date())) and dt.time() < datetime.time(15, 0, 0):
        return str(dt)
    else:
        # print('before')
        # print(QA_util_date_gap(str(dt.date()),1,'lt'))
        return '{} {}'.format(
            QA_util_date_gap(str(dt.date()),
                             1,
                             'lt'),
            dt.time()
        )
241579
@CheckForNull
  public static Date parseDateTimeQuietly(@Nullable String s) {
    Date datetime = null;
    if (s != null) {
      try {
        datetime = parseDateTime(s);
      } catch (RuntimeException e) {
        // ignore
      }

    }
    return datetime;
  }
427141
private String formatDateTime(Object value)
   {
      String result = null;
      if (value instanceof Date)
      {
         result = m_formats.getDateTimeFormat().format(value);
      }
      return result;
   }
86347
function datetime(date, format) {
    if (format === undefined) {
        //datetime() => now timestamp
        if (date === undefined) {
            return Math.floor(Date.now() / 1000);
        } else if (lodash.isString(date)) { //datetime('2017-01-01') => timestamp
            date = date || new Date();
            return Math.floor(new Date(date).getTime() / 1000);
        }
        return NaN;
    } else {
        format = format || 'yyyy-mm-dd hh:mi:ss';
        let fn = function (d, f) {
            let Week = ['日', '一', '二', '三', '四', '五', '六'];
            f = f.replace(/yyyy|YYYY/, d.getFullYear());
            f = f.replace(/yy|YY/, d.getYear() % 100 > 9 ? (d.getYear() % 100).toString() : '0' + d.getYear() % 100);
            f = f.replace(/mi|MI/, d.getMinutes() > 9 ? d.getMinutes().toString() : '0' + d.getMinutes());
            f = f.replace(/mm|MM/, d.getMonth() + 1 > 9 ? (d.getMonth() + 1).toString() : '0' + (d.getMonth() + 1));
            f = f.replace(/m|M/g, d.getMonth() + 1);
            f = f.replace(/w|W/g, Week[d.getDay()]);
            f = f.replace(/dd|DD/, d.getDate() > 9 ? d.getDate().toString() : '0' + d.getDate());
            f = f.replace(/d|D/g, d.getDate());
            f = f.replace(/hh|HH/, d.getHours() > 9 ? d.getHours().toString() : '0' + d.getHours());
            f = f.replace(/h|H/g, d.getHours());
            f = f.replace(/ss|SS/, d.getSeconds() > 9 ? d.getSeconds().toString() : '0' + d.getSeconds());
            return f;
        };
        if (date && lodash.isNumber(date)) {
            let newDate = new Date();
            newDate.setTime(date * 1000);
            return fn(newDate, format);
        }
        if (date && lodash.isString(date)) {
            return fn(new Date(Date.parse(date)), format);
        }
        return fn(new Date(), format);
    }
}
1242947
def datetime_handler(x):
    
    if isinstance(x, datetime.datetime) or isinstance(x, datetime.date):
        return x.isoformat()
    raise TypeError("Unknown type")
579921
public void setDateTime(String dateTimeString)
    {
		Date dateTime = null;
		try	{
            if ((dateTimeString != null) && (dateTimeString.length() > 0))
                dateTime = dateTimeFormat.parse(dateTimeString);
		} catch (Exception e)	{
            dateTime = null;
		}
        this.setDateTime(dateTime);
    }
1348056
function (type) {
            var ret = null, meth;
            if (isString(type)) {
                ret = this._static.CAST_TYPES[type] || this._super(arguments);
            } else if (type === String) {
                meth += "CHAR";
            } else if (type === Number) {
                meth += "DECIMAL";
            } else if (type === DateTime) {
                meth += "DATETIME";
            } else if (type === Year) {
                meth += "Year";
            } else if (type === Time) {
                meth += "DATETIME";
            } else if (type === Double) {
                meth += "DECIMAL";
            } else {
                ret = this._super(arguments);
            }
            return ret;
        }
309294
public static String toStringWithMinutes( DateTime dateTime ) {
        String dtStr = dateTime.toString(withMinutesformatter);
        return dtStr;
    }
977564
function shouldInvoke(time) {
    let timeSinceLastCall = time - lastCallTime;

    let timeSinceLastInvoke = time - lastInvokeTime;
    // 几种满足条件的情况
    return (lastCallTime === undefined ||
      (timeSinceLastCall >= wait) ||
      (timeSinceLastCall < 0) ||
      (maxing && timeSinceLastInvoke >= maxWait)); // 超过最大等待时间
  }
721896
public static DateTime toDate(String str, boolean alsoNumbers, TimeZone tz, DateTime defaultValue) {
	return DateCaster.toDateAdvanced(str, alsoNumbers ? DateCaster.CONVERTING_TYPE_OFFSET : DateCaster.CONVERTING_TYPE_NONE, tz, defaultValue);
    }
892194
public static String getDateTimeDisp(String datetime) {
		if ((datetime == null) || (datetime.equals("")))
			return "";

		DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
		long datel = Long.parseLong(datetime);
		return formatter.format(new Date(datel));

	}
805131
protected boolean isLastTime(Date lastBackupTime) {
		if (lastBackupTime == null) {
			return true;
		}
		long diff = System.currentTimeMillis() - lastBackupTime.getTime();
		if (diff > (this.getInterval() * 1000L)) {
			// 10分钟前的时间算是上次备份时间
			return true;
		}
		return false;
	}
706251
public static String toStringWithSeconds( DateTime dateTime ) {
        String dtStr = dateTime.toString(withSecondsformatter);
        return dtStr;
    }
16018
public static DateTime toDateTime(Locale locale, String str, TimeZone tz, DateTime defaultValue, boolean useCommomDateParserAsWell) {
	str = str.trim();
	tz = ThreadLocalPageContext.getTimeZone(tz);
	DateFormat[] df;

	// get Calendar
	Calendar c = JREDateTimeUtil.getThreadCalendar(locale, tz);

	// datetime
	ParsePosition pp = new ParsePosition(0);
	df = FormatUtil.getDateTimeFormats(locale, tz, false);// dfc[FORMATS_DATE_TIME];
	Date d;
	for (int i = 0; i < df.length; i++) {
	    SimpleDateFormat sdf = (SimpleDateFormat) df[i];
	    // print.e(sdf.format(new Date(108,3,6,1,2,1)) + " : "+sdf.toPattern());
	    pp.setErrorIndex(-1);
	    pp.setIndex(0);
	    sdf.setTimeZone(tz);
	    d = sdf.parse(str, pp);
	    if (pp.getIndex() == 0 || d == null || pp.getIndex() < str.length()) continue;

	    optimzeDate(c, tz, d);
	    return new DateTimeImpl(c.getTime());
	}

	// date
	df = FormatUtil.getDateFormats(locale, tz, false);
	for (int i = 0; i < df.length; i++) {
	    SimpleDateFormat sdf = (SimpleDateFormat) df[i];
	    // print.e(sdf.format(new Date(108,3,6,1,2,1)) + " : "+sdf.toPattern());
	    pp.setErrorIndex(-1);
	    pp.setIndex(0);
	    sdf.setTimeZone(tz);
	    d = sdf.parse(str, pp);
	    if (pp.getIndex() == 0 || d == null || pp.getIndex() < str.length()) continue;
	    optimzeDate(c, tz, d);
	    return new DateTimeImpl(c.getTime());
	}

	// time
	df = FormatUtil.getTimeFormats(locale, tz, false);// dfc[FORMATS_TIME];
	for (int i = 0; i < df.length; i++) {
	    SimpleDateFormat sdf = (SimpleDateFormat) df[i];
	    // print.e(sdf.format(new Date(108,3,6,1,2,1))+ " : "+sdf.toPattern());
	    pp.setErrorIndex(-1);
	    pp.setIndex(0);
	    sdf.setTimeZone(tz);
	    d = sdf.parse(str, pp);
	    if (pp.getIndex() == 0 || d == null || pp.getIndex() < str.length()) continue;
	    c.setTimeZone(tz);
	    c.setTime(d);
	    c.set(Calendar.YEAR, 1899);
	    c.set(Calendar.MONTH, 11);
	    c.set(Calendar.DAY_OF_MONTH, 30);
	    c.setTimeZone(tz);
	    return new DateTimeImpl(c.getTime());
	}

	if (useCommomDateParserAsWell) return DateCaster.toDateSimple(str, CONVERTING_TYPE_NONE, true, tz, defaultValue);
	return defaultValue;
    }