public class Time extends Object
Constructor and Description |
---|
Time() |
Modifier and Type | Method and Description |
---|---|
static int |
currentTime()
Returns current time in seconds adjusted by adding {@link #offset) seconds.
|
static long |
currentTimeMillis()
Returns current time in milliseconds adjusted by adding {@link #offset) seconds.
|
static int |
getOffset() |
static void |
setOffset(int offset)
Sets time offset in seconds that will be added to
currentTime() and currentTimeMillis() . |
static Date |
toDate(int time)
Returns
Date object, its value set to time |
static Date |
toDate(long time)
Returns
Date object, its value set to time |
static long |
toMillis(int time)
Returns time in milliseconds for a time in seconds.
|
public static int currentTime()
public static long currentTimeMillis()
public static Date toDate(int time)
Date
object, its value set to timetime
- Time in milliseconds since the epochpublic static Date toDate(long time)
Date
object, its value set to timetime
- Time in milliseconds since the epochpublic static long toMillis(int time)
time
- Time in seconds since the epochpublic static int getOffset()
currentTime()
and currentTimeMillis()
.public static void setOffset(int offset)
currentTime()
and currentTimeMillis()
.offset
- Offset (in seconds)Copyright © 2019 JBoss by Red Hat. All rights reserved.