MySQL Connector/J size='-1'>5.0.8

com.mysql.jdbc
Class TimeUtil

java.lang.Object
  extended bycom.mysql.jdbc.TimeUtil

public class TimeUtil
extends java.lang.Object

Timezone conversion routines

Author:
Mark Matthews

Constructor Summary
TimeUtil()
           
 
Method Summary
static java.sql.Timestamp changeTimezone(Connection 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(Connection 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
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
 

Constructor Detail

TimeUtil

public TimeUtil()
Method Detail

changeTimezone

public static java.sql.Time changeTimezone(Connection 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

Parameters:
conn - the current connection to the MySQL server
t - the times to change
fromTz - the timezone to change from
toTz - the timezone to change to
Returns:
the times changed to the timezone 'toTz'

changeTimezone

public static java.sql.Timestamp changeTimezone(Connection 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

Parameters:
conn - the current connection to the MySQL server
tstamp - the timestamp to change
fromTz - the timezone to change from
toTz - the timezone to change to
Returns:
the timestamp changed to the timezone 'toTz'

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!

MySQL Connector/J size='-1'>5.0.8