public final class TimestampFactory extends Object
ITimestamp time stamps.| Modifier and Type | Method and Description |
|---|---|
static ITimestamp |
createTimestamp(long seconds,
long nanoseconds)
Creates a time stamp based on the specified seconds and nanoseconds.
|
static ITimestamp |
fromCalendar(Calendar calendar)
Create a time stamp for the given Calendar.
|
static ITimestamp |
fromDouble(double seconds)
Creates a time stamp based on the specified seconds.
|
static ITimestamp |
fromMillisecs(long millisecs)
Create a time stamp for the given milliseconds since the epoch.
|
static ITimestamp |
now()
Creates a time stamp for the current system time.
|
public static ITimestamp createTimestamp(long seconds, long nanoseconds)
Refer to ITimestamp for details on epoch etc.
The nanoseconds will get normalised, i.e. it's OK to provide nanoseconds that amount to seconds.
seconds - Seconds since 1970 epochnanoseconds - Nanoseconds within the secondspublic static ITimestamp now()
public static ITimestamp fromDouble(double seconds)
Refer to ITimestamp for details on epoch etc.
seconds - Seconds since 1970 epochpublic static ITimestamp fromCalendar(Calendar calendar)
calendar - Calendar value to convert into time stamppublic static ITimestamp fromMillisecs(long millisecs)
millisecs - Milliseconds since 1970 epochCopyright © 2023 European Spallation Source. All rights reserved.