public class TimeUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static long |
msb0baseTime
Taken from org.apache.commons.net.ntp.TimeStamp.
|
protected static long |
msb1baseTime
Taken from org.apache.commons.net.ntp.TimeStamp.
|
Constructor and Description |
---|
TimeUtils() |
Modifier and Type | Method and Description |
---|---|
static long |
constuctNtp(long msw,
long lsw)
Constructs a
long representation of a timestamp in NTP Timestamp
Format (see "http://tools.ietf.org/html/rfc5905#section-6"). |
static long |
getLsw(long ntpTime)
Gets the least significant word (32bits) from an NTP Timestamp
represented as a long.
|
static long |
getMsw(long ntpTime)
Gets the most significant word (32bits) from an NTP Timestamp represented
as a long.
|
static long |
getTime(long ntpTimeValue)
Taken from from org.apache.commons.net.ntp.TimeStamp#toNtpTime(long)
Convert 64-bit NTP timestamp to Java standard time.
|
static long |
ntpShortToMs(long ntpShortTime)
Converts a timestamp in NTP Short Format (Q16.16, see
"http://tools.ietf.org/html/rfc5905#section-6") into
milliseconds.
|
static long |
rtpDiff(long a,
long b)
Deprecated.
|
static long |
toNtpShortFormat(long ntpTime)
Converts the given timestamp in NTP Timestamp Format into NTP Short
Format (see "http://tools.ietf.org/html/rfc5905#section-6").
|
static long |
toNtpTime(long t)
Taken from from org.apache.commons.net.ntp.TimeStamp#toNtpTime(long)
Converts Java time to 64-bit NTP time representation.
|
protected static final long msb0baseTime
protected static final long msb1baseTime
public static long toNtpTime(long t)
t
- Java timepublic static long getTime(long ntpTimeValue)
ntpTimeValue
- the input timepublic static long toNtpShortFormat(long ntpTime)
ntpTime
- the timestamp to convert.public static long ntpShortToMs(long ntpShortTime)
ntpShortTime
- the timestamp in NTP Short Format to convert.public static long constuctNtp(long msw, long lsw)
long
representation of a timestamp in NTP Timestamp
Format (see "http://tools.ietf.org/html/rfc5905#section-6").msw
- The most significant word (32bits) represented as a long.lsw
- The least significant word (32bits) represented as a long.msw
and lsw
.public static long getMsw(long ntpTime)
ntpTime
- the timestamp in NTP Timestamp Format.ntpTime
.public static long getLsw(long ntpTime)
ntpTime
- the timestamp in NTP Timestamp Format.ntpTime
.@Deprecated public static long rtpDiff(long a, long b)
RTPUtils.rtpTimestampDiff(long, long)
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.