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 booleanISO8601_WEEKstatic StringISO8601_WEEK_PROP
-
Constructor Summary
Constructors Constructor Description TimestampWithTimezone()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Objectcreate(Date date, TimeZone initial, Calendar target, Class<?> type)static DatecreateDate(Date date)Creates normalized SQL Date Objectstatic DatecreateDate(Date date, TimeZone initial, Calendar target)static TimecreateTime(Date date)Creates normalized SQL Time Objectstatic TimecreateTime(Date date, TimeZone initial, Calendar target)static TimestampcreateTimestamp(Date date)static TimestampcreateTimestamp(Date date, TimeZone initial, Calendar target)static CalendargetCalendar()static voidresetCalendar(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
-
-