Skip to content

Instantly share code, notes, and snippets.

@wmuron
Created October 20, 2016 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmuron/709f87f70d44e2f736b36f896f1cd4f4 to your computer and use it in GitHub Desktop.
Save wmuron/709f87f70d44e2f736b36f896f1cd4f4 to your computer and use it in GitHub Desktop.
import org.hibernate.type.DateType;
public class UtcDateType extends DateType {
private static final TimeZone UTC = TimeZone.getTimeZone("UTC");
@Override
public Object get(ResultSet rs, String name) throws SQLException {
return rs.getDate(name, Calendar.getInstance(UTC));
}
@Override
public void set(PreparedStatement st, Object value, int index) throws SQLException{...}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment