Java Milliseconds getExpirationMillisAbs(int recordExpirationTimestamp)

Here you can find the source of getExpirationMillisAbs(int recordExpirationTimestamp)

Description

get Expiration Millis Abs

License

Apache License

Parameter

Parameter Description
recordExpirationTimestamp Timestamp when record expires, in seconds since Jan 01 2010 00:00:00 GMT (absolute)

Return

Expiration time in millis

Declaration

public static long getExpirationMillisAbs(int recordExpirationTimestamp) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int AS_TIMEBASE_SEC = 1262304000;

    /**//from ww  w  .  j  a v  a2 s.c om
     * @param recordExpirationTimestamp Timestamp when record expires, in seconds since Jan 01 2010 00:00:00 GMT (absolute)
     * @return Expiration time in millis
     */
    public static long getExpirationMillisAbs(int recordExpirationTimestamp) {
        long timestamp;

        // Aerospike expiry settings are messed up: you put in -1 and get back 0
        if (recordExpirationTimestamp == 0) {
            timestamp = -1; // default expiration setting: -1 - no expiration set
        } else {
            // convert record expiration time (seconds from 01/01/2010 0:0:0 GMT)
            // to java epoch time in milliseconds
            timestamp = 1000L * (AS_TIMEBASE_SEC + recordExpirationTimestamp);
        }
        return timestamp;
    }
}

Related

  1. fractionOfDayToMilliseconds(float fFractionOfDay)
  2. getDurationFromMillis(final long millis)
  3. getDurationSecFromMillisDouble(long millis)
  4. getElapsedTimeInMilliseconds(Date startDate, Date endDate)
  5. getExpirationInMilliSeconds(long currentTime, int expirationTime)
  6. getFullSecondsElapsedTimeMillis(long start, long end)
  7. getLogTimeFromMillis(Long millis)
  8. getMillis()
  9. getMillis()