Package org.teiid.transport.pg
Class TimestampUtils
- java.lang.Object
-
- org.teiid.transport.pg.TimestampUtils
-
public class TimestampUtils extends Object
Slimmed down from org.postgresql.jdbc2.TimestampUtils
-
-
Field Summary
Fields Modifier and Type Field Description static longDATE_NEGATIVE_INFINITYstatic longDATE_NEGATIVE_SMALLER_INFINITYstatic longDATE_POSITIVE_INFINITYstatic longDATE_POSITIVE_SMALLER_INFINITY
-
Constructor Summary
Constructors Constructor Description TimestampUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DatetoDate(TimeZone tz, int days)Returns the SQL Date object given the timezone and number of daysstatic longtoPgSecs(long secs)Converts the given java seconds to postgresql seconds.
-
-
-
Field Detail
-
DATE_POSITIVE_INFINITY
public static final long DATE_POSITIVE_INFINITY
- See Also:
- Constant Field Values
-
DATE_NEGATIVE_INFINITY
public static final long DATE_NEGATIVE_INFINITY
- See Also:
- Constant Field Values
-
DATE_POSITIVE_SMALLER_INFINITY
public static final long DATE_POSITIVE_SMALLER_INFINITY
- See Also:
- Constant Field Values
-
DATE_NEGATIVE_SMALLER_INFINITY
public static final long DATE_NEGATIVE_SMALLER_INFINITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
toDate
public static Date toDate(TimeZone tz, int days)
Returns the SQL Date object given the timezone and number of days- Parameters:
tz- The timezone used.- Returns:
- The parsed date object.
-
toPgSecs
public static long toPgSecs(long secs)
Converts the given java seconds to postgresql seconds. SeetoJavaSecs(long)for the reverse operation. The conversion is valid for any year 100 BC onwards.- Parameters:
secs- Postgresql seconds.- Returns:
- Java seconds.
-
-