public class TimestampUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
DATE_NEGATIVE_INFINITY |
static long |
DATE_NEGATIVE_SMALLER_INFINITY |
static long |
DATE_POSITIVE_INFINITY |
static long |
DATE_POSITIVE_SMALLER_INFINITY |
| Constructor and Description |
|---|
TimestampUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Time |
convertToTime(long millis,
TimeZone tz)
Extracts the time part from a timestamp.
|
static Date |
toDate(TimeZone tz,
int days)
Returns the SQL Date object given the timezone and number of days
|
static long |
toPgSecs(long secs)
Converts the given java seconds to postgresql seconds.
|
static Timestamp |
toTimestamp(long time,
TimeZone tz) |
public static final long DATE_POSITIVE_INFINITY
public static final long DATE_NEGATIVE_INFINITY
public static final long DATE_POSITIVE_SMALLER_INFINITY
public static final long DATE_NEGATIVE_SMALLER_INFINITY
public static Date toDate(TimeZone tz, int days)
tz - The timezone used.public static long toPgSecs(long secs)
toJavaSecs(long) for the reverse operation.
The conversion is valid for any year 100 BC onwards.secs - Postgresql seconds.public static Timestamp toTimestamp(long time, TimeZone tz)
time - in microsecondstz - public static Time convertToTime(long millis, TimeZone tz)
millis - The timestamp from which to extract the time.tz - timezone to use.Copyright © 2020. All rights reserved.