org.modeshape.jdbc.util
Class TimestampWithTimezone
java.lang.Object
org.modeshape.jdbc.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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DATETIME_FORMAT
public static DateFormat DATETIME_FORMAT
DATE_FORMAT
public static DateFormat DATE_FORMAT
TIME_FORMAT
public static DateFormat TIME_FORMAT
TimestampWithTimezone
public TimestampWithTimezone()
getCalendar
public static Calendar getCalendar()
resetCalendar
public static void resetCalendar(TimeZone tz)
createTimestamp
public static Timestamp createTimestamp(Calendar initial,
Calendar target)
createTime
public static Time createTime(Calendar initial,
Calendar target)
createDate
public static Date createDate(Calendar initial,
Calendar target)
createTime
public static Time createTime(Calendar target)
- Creates normalized SQL Time Object based on
the target Calendar.
- Parameters:
target
- Calendar
- Returns:
- Time
createDate
public static Date createDate(Calendar target)
- Creates normalized SQL Date Object based on
the target Calendar
- Parameters:
target
- Calendar
- Returns:
- Date
createTimestamp
public static Timestamp createTimestamp(Calendar target)
- Creates normalized SQL Timestamp Object based on
the target Calendar
- Parameters:
target
- Calendar
- Returns:
- Timestamp
Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.