com.mysql.jdbc
public class TimeUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.util.Map<java.lang.String,java.lang.String[]> |
ABBREVIATED_TIMEZONES |
(package private) static java.util.TimeZone |
GMT_TIMEZONE |
(package private) static java.util.Map<java.lang.String,java.lang.String> |
TIMEZONE_MAPPINGS |
Constructor and Description |
---|
TimeUtil() |
Modifier and Type | Method and Description |
---|---|
static java.sql.Timestamp |
changeTimezone(MySQLConnection conn,
java.util.Calendar sessionCalendar,
java.util.Calendar targetCalendar,
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(MySQLConnection conn,
java.util.Calendar sessionCalendar,
java.util.Calendar targetCalendar,
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.Date |
fastDateCreate(int year,
int month,
int day,
java.util.Calendar targetCalendar) |
(package private) static java.sql.Time |
fastTimeCreate(java.util.Calendar cal,
int hour,
int minute,
int second,
ExceptionInterceptor exceptionInterceptor) |
(package private) static java.sql.Time |
fastTimeCreate(int hour,
int minute,
int second,
java.util.Calendar targetCalendar,
ExceptionInterceptor exceptionInterceptor) |
(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) |
(package private) static java.sql.Timestamp |
fastTimestampCreate(java.util.TimeZone tz,
int year,
int month,
int day,
int hour,
int minute,
int seconds,
int secondsPart) |
static java.lang.String |
formatNanos(int nanos,
boolean serverSupportsFracSecs) |
static java.lang.String |
getCanoncialTimezone(java.lang.String timezoneStr,
ExceptionInterceptor exceptionInterceptor)
Returns the 'official' Java timezone name for the given timezone
|
static final java.util.Map<java.lang.String,java.lang.String[]> ABBREVIATED_TIMEZONES
static final java.util.TimeZone GMT_TIMEZONE
static final java.util.Map<java.lang.String,java.lang.String> TIMEZONE_MAPPINGS
public static java.sql.Time changeTimezone(MySQLConnection conn, java.util.Calendar sessionCalendar, java.util.Calendar targetCalendar, java.sql.Time t, java.util.TimeZone fromTz, java.util.TimeZone toTz, boolean rollForward)
conn
- the current connection to the MySQL servert
- the times to changefromTz
- the timezone to change fromtoTz
- the timezone to change topublic static java.sql.Timestamp changeTimezone(MySQLConnection conn, java.util.Calendar sessionCalendar, java.util.Calendar targetCalendar, java.sql.Timestamp tstamp, java.util.TimeZone fromTz, java.util.TimeZone toTz, boolean rollForward)
conn
- the current connection to the MySQL servertstamp
- the timestamp to changefromTz
- the timezone to change fromtoTz
- the timezone to change tostatic final java.sql.Date fastDateCreate(boolean useGmtConversion, java.util.Calendar gmtCalIfNeeded, java.util.Calendar cal, int year, int month, int day)
static final java.sql.Date fastDateCreate(int year, int month, int day, java.util.Calendar targetCalendar)
static final java.sql.Time fastTimeCreate(java.util.Calendar cal, int hour, int minute, int second, ExceptionInterceptor exceptionInterceptor) throws java.sql.SQLException
java.sql.SQLException
static final java.sql.Time fastTimeCreate(int hour, int minute, int second, java.util.Calendar targetCalendar, ExceptionInterceptor exceptionInterceptor) throws java.sql.SQLException
java.sql.SQLException
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)
static final java.sql.Timestamp fastTimestampCreate(java.util.TimeZone tz, int year, int month, int day, int hour, int minute, int seconds, int secondsPart)
public static java.lang.String getCanoncialTimezone(java.lang.String timezoneStr, ExceptionInterceptor exceptionInterceptor) throws java.sql.SQLException
timezoneStr
- the 'common' timezone namejava.sql.SQLException
java.lang.IllegalArgumentException
- DOCUMENT ME!public static java.lang.String formatNanos(int nanos, boolean serverSupportsFracSecs)