For MySQL only, an alternative to implementing custom Hibernate types is to add the following JDBC options to your JDBC connection URL:
useTimezone=true
serverTimezone=UTC
This will force your JDBC connection into the UTC timezone and ask MySQL to perform conversions from the JVM timezone. The net effect is that you can keep a local timezone on your JVM (e.g. for printing out log messages and so forth), while DATETIME columns will be persisted as UTC.
For example:
<bean id="hibernateAnalysisSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="hibernateProperties">
<props>
<!-- Connection parameters -->
<prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>
<prop key="hibernate.connection.url">jdbc:mysql://hostname/databaseName?useTimezone=true&serverTimezone=UTC</prop>
...