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

LonggetCurrentMillisecond()
get Current Millisecond
return System.currentTimeMillis();
StringgetCurrentMillisecondString()
Returns a string of current timestamp with millisecond precision.
return String.valueOf(System.currentTimeMillis());
StringgetCurrentMillisecondZeroFillString()
Returns a string of timestamp with millisecond precision and the length of LONG_TYPE_MAX_LENGTH .
return getCurrentMillisecondZeroFillString(LONG_TYPE_MAX_LENGTH);
StringgetCurrentTimeMillisStr()
get Current Time Millis Str
return (new Long(System.currentTimeMillis()).toString());
longgetMillins(String yyyyMMddHHmmss)
get Millins
long d = 0;
try {
    java.util.Date date = new java.util.Date();
    java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyyMMddhhmmss");
    date = formatter.parse(yyyyMMddHHmmss);
    java.util.Calendar c = java.util.Calendar.getInstance();
    c.setTime(date);
    d = c.getTimeInMillis();
...
StringgetMillisDurationString(long millis)
get Millis Duration String
long secs = millis / 1000;
long mins = secs / 60;
long remainingSecs = secs % 60;
if (mins > 0) {
    return String.format("%d mins %d secs", mins, remainingSecs);
} else {
    return String.format("%.3f secs", millis / 1000.0);
longgetMillisec_old(String isoDate)
get Milliseold
Date date = null;
formatISODefault.setTimeZone(TimeZone.getTimeZone("GMT"));
try {
    date = formatISODefault.parse(isoDate);
} catch (ParseException e) {
    e.printStackTrace();
return date.getTime();
...
StringgetMillisecondStamp(Date date)
get Millisecond Stamp
DateFormat fmt = new SimpleDateFormat("HHmmssSSS");
return fmt.format(date);
longgetMilliSecondToTomorrow(Date date)
get Milli Second To Tomorrow
String today = formatDD(date);
Date today0 = parseDD(today);
return (86400000 - (date.getTime() - today0.getTime()));
LonggetMillisFromISO8601(Object iso8601)
FIX: In order to make EPL nested calls like: com.ebay.jetstream.util.DateUtil.getMillisFromISO8601(com.ebay.jetstream.epl .EPLUtilities.getAttributeValue(attributes.values, 'marketplace.transaction_date')) possible, we need this guy to be able to accept Object which is a string actually
Date iso8601Date = getDateFromISO8601(iso8601);
return iso8601Date == null ? null : iso8601Date.getTime();