Package org.teiid.core.util
Class TimestampWithTimezone
- java.lang.Object
-
- org.teiid.core.util.TimestampWithTimezone
-
public class TimestampWithTimezone extends Object
Utility methods for SQL Timestamps, Time, and Dates with time zones as UTC This is intended to take incoming Strings or Dates that have accurate Calendar fields and give the UTC time by interpretting those fields in the target time zone. Use of the Calendar object passed in will not be thread safe, but it will not alter the contents of the Calendar. Note that normalization occurs only for the transition from one type to another.
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
ISO8601_WEEK
static String
ISO8601_WEEK_PROP
-
Constructor Summary
Constructors Constructor Description TimestampWithTimezone()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
create(Date date, TimeZone initial, Calendar target, Class<?> type)
static Date
createDate(Date date)
Creates normalized SQL Date Objectstatic Date
createDate(Date date, TimeZone initial, Calendar target)
static Time
createTime(Date date)
Creates normalized SQL Time Objectstatic Time
createTime(Date date, TimeZone initial, Calendar target)
static Timestamp
createTimestamp(Date date)
static Timestamp
createTimestamp(Date date, TimeZone initial, Calendar target)
static Calendar
getCalendar()
static void
resetCalendar(TimeZone tz)
-
-
-
Field Detail
-
ISO8601_WEEK_PROP
public static final String ISO8601_WEEK_PROP
- See Also:
- Constant Field Values
-
ISO8601_WEEK
public static final boolean ISO8601_WEEK
-
-
Method Detail
-
getCalendar
public static Calendar getCalendar()
-
resetCalendar
public static void resetCalendar(TimeZone tz)
-
createTimestamp
public static Timestamp createTimestamp(Date date, TimeZone initial, Calendar target)
-
createTime
public static Time createTime(Date date)
Creates normalized SQL Time Object- Returns:
- Time
- Since:
- 4.3
-
createDate
public static Date createDate(Date date)
Creates normalized SQL Date Object- Returns:
- Date
- Since:
- 4.3
-
-