Package com.teamdev.jxbrowser.time
Interface Timestamp
public interface Timestamp
A point in time independent of any time zone or calendar, represented as milliseconds in UTC UNIX
Epoch time.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Timestamp
fromMicros
(long microseconds) Creates aTimestamp
from the number of microseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.static Timestamp
fromMillis
(long milliseconds) Creates aTimestamp
from the number of milliseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.static Timestamp
fromSeconds
(long seconds) Creates aTimestamp
from the number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.default long
toMicros()
Returns the number of microseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.default long
toMillis()
Returns the number of milliseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.default long
Returns the number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.
-
Field Details
-
NONE
TheTimestamp
from the number of microseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z set to none.
-
-
Method Details
-
fromSeconds
Creates aTimestamp
from the number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.- Parameters:
seconds
- the number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z- Returns:
- a
Timestamp
from the number of seconds of UTC time since Unix epoch - Throws:
IllegalArgumentException
- when theseconds
argument is negative
-
fromMillis
Creates aTimestamp
from the number of milliseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.- Parameters:
milliseconds
- the number of milliseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z- Returns:
- a
Timestamp
from the number of milliseconds of UTC time since Unix epoch - Throws:
IllegalArgumentException
- when themilliseconds
argument is negative
-
fromMicros
Creates aTimestamp
from the number of microseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z.- Parameters:
microseconds
- the number of microseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z- Returns:
- a
Timestamp
from the number of microseconds of UTC time since Unix epoch - Throws:
IllegalArgumentException
- when themicroseconds
argument is negative
-
toMicros
default long toMicros()Returns the number of microseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.- Returns:
- the number of microseconds of UTC time since Unix epoch
-
toMillis
default long toMillis()Returns the number of milliseconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.- Returns:
- the number of milliseconds of UTC time since Unix epoch
-
toSeconds
default long toSeconds()Returns the number of seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.- Returns:
- the number of seconds of UTC time since Unix epoch
-