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 Date |
toDate(TimeZone tz,
int days)
Returns the SQL Date object matching the given bytes with
Oid#DATE . |
static long |
toPgSecs(long secs)
Converts the given java seconds to postgresql seconds.
|
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)
Oid#DATE
.tz
- The timezone used.bytes
- The binary encoded date value.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.Copyright © 2018 JBoss by Red Hat. All rights reserved.