Java Utililty Methods Millisecond Current Get

List of utility methods to do Millisecond Current Get

Description

The list of methods to do Millisecond Current Get are organized into topic(s).

Method

LonggetMillisFromRFC822String(Object rfc822)
FIX: In order to make EPL nested calls, we need this guy to be able to accept Object which is a string actually
Date rfc822Date = getDateFromRFC822String(rfc822);
return rfc822Date == null ? null : rfc822Date.getTime();
longgetMillisFromString(String s)
get Millis From String
DateFormat formater = DateFormat.getDateTimeInstance();
Date date = formater.parse(s);
return date.getTime();
LonggetMillisFromYYYYMMDD(Object yyyymmdd)
Helper parsing two kinds of dates:
1.
Date date = getDateYYYYMMDD(yyyymmdd);
return date == null ? null : date.getTime();
StringgetMillisId()
use time generate the id
return formatCurrentTime("yyyyMMddHHmmssSSS");
longgetMillisOfTowDiffDate(String p_startDate, String p_endDate)
get Millis Of Tow Diff Date
Date l_startDate = toUtilDateFromStrDateByFormat(p_startDate, "yyyy-MM-dd HH:mm:ss");
Date l_endDate = toUtilDateFromStrDateByFormat(p_endDate, "yyyy-MM-dd HH:mm:ss");
long l_startTime = getMillisOfDate(l_startDate);
long l_endTime = getMillisOfDate(l_endDate);
return (long) (l_endTime - l_startTime);
StringgetMillon(long time)
get Millon
return new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(time);