com.mysql.jdbc
Class TimeUtil
java.lang.Object
com.mysql.jdbc.TimeUtil
- public class TimeUtil
- extends java.lang.Object
Timezone conversion routines
Method Summary |
static java.sql.Timestamp |
changeTimezone(Connection conn,
java.sql.Timestamp tstamp,
java.util.TimeZone fromTz,
java.util.TimeZone toTz,
boolean rollForward)
Change the given timestamp from one timezone to another |
static java.sql.Time |
changeTimezone(Connection conn,
java.sql.Time t,
java.util.TimeZone fromTz,
java.util.TimeZone toTz,
boolean rollForward)
Change the given times from one timezone to another |
(package private) static java.sql.Date |
fastDateCreate(boolean useGmtConversion,
java.util.Calendar gmtCalIfNeeded,
java.util.Calendar cal,
int year,
int month,
int day)
|
(package private) static java.sql.Time |
fastTimeCreate(java.util.Calendar cal,
int hour,
int minute,
int second)
|
(package private) static java.sql.Timestamp |
fastTimestampCreate(boolean useGmtConversion,
java.util.Calendar gmtCalIfNeeded,
java.util.Calendar cal,
int year,
int month,
int day,
int hour,
int minute,
int seconds,
int secondsPart)
|
static java.lang.String |
getCanoncialTimezone(java.lang.String timezoneStr)
Returns the 'official' Java timezone name for the given timezone |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ABBREVIATED_TIMEZONES
static final java.util.Map ABBREVIATED_TIMEZONES
GMT_TIMEZONE
static final java.util.TimeZone GMT_TIMEZONE
TIMEZONE_MAPPINGS
static final java.util.Map TIMEZONE_MAPPINGS
TimeUtil
public TimeUtil()
changeTimezone
public static java.sql.Time changeTimezone(Connection conn,
java.sql.Time t,
java.util.TimeZone fromTz,
java.util.TimeZone toTz,
boolean rollForward)
- Change the given times from one timezone to another
- Parameters:
conn
- the current connection to the MySQL servert
- the times to changefromTz
- the timezone to change fromtoTz
- the timezone to change to
- Returns:
- the times changed to the timezone 'toTz'
changeTimezone
public static java.sql.Timestamp changeTimezone(Connection conn,
java.sql.Timestamp tstamp,
java.util.TimeZone fromTz,
java.util.TimeZone toTz,
boolean rollForward)
- Change the given timestamp from one timezone to another
- Parameters:
conn
- the current connection to the MySQL servertstamp
- the timestamp to changefromTz
- the timezone to change fromtoTz
- the timezone to change to
- Returns:
- the timestamp changed to the timezone 'toTz'
fastDateCreate
static final java.sql.Date fastDateCreate(boolean useGmtConversion,
java.util.Calendar gmtCalIfNeeded,
java.util.Calendar cal,
int year,
int month,
int day)
fastTimeCreate
static final java.sql.Time fastTimeCreate(java.util.Calendar cal,
int hour,
int minute,
int second)
fastTimestampCreate
static final java.sql.Timestamp fastTimestampCreate(boolean useGmtConversion,
java.util.Calendar gmtCalIfNeeded,
java.util.Calendar cal,
int year,
int month,
int day,
int hour,
int minute,
int seconds,
int secondsPart)
getCanoncialTimezone
public static java.lang.String getCanoncialTimezone(java.lang.String timezoneStr)
- Returns the 'official' Java timezone name for the given timezone
- Parameters:
timezoneStr
- the 'common' timezone name
- Returns:
- the Java timezone name for the given timezone
- Throws:
java.lang.IllegalArgumentException
- DOCUMENT ME!