Skip to content

Commit ca1b7e3

Browse files
committed
Fixing timestamps.
1 parent 0d9cde8 commit ca1b7e3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/test/java/org/zalando/typemapper/AbstractTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void setUp() throws Exception {
6868

6969
execute("CREATE TABLE tmp.test_time(lt timestamp without time zone, gt timestamp with time zone, zone text);");
7070
execute(
71-
"INSERT INTO tmp.test_time(lt, gt, zone) VALUES ('2012-07-30 16:00:00+0' AT TIME ZONE 'UTC', '2012-07-30 16:00:00+0', 'utc'), ('2012-07-30 16:00:00+2' AT TIME ZONE 'UTC', '2012-07-30 18:00:00+2', 'cest'), ('2012-07-30 19:00:00+2' AT TIME ZONE 'UTC', '2012-08-01 04:00:00+09', 'japan');");
71+
"INSERT INTO tmp.test_time(lt, gt, zone) VALUES ('2012-07-25 16:00:00+0' AT TIME ZONE 'UTC', '2012-07-25 16:00:00+0', 'utc'), ('2012-07-26 16:00:00+0' AT TIME ZONE 'UTC', '2012-07-26 18:00:00+2', 'cest'), ('2012-07-29 19:00:00+0' AT TIME ZONE 'UTC', '2012-07-30 04:00:00+09', 'japan');");
7272

7373
final String test_time_sproc =
7474
"CREATE OR REPLACE FUNCTION tmp.test_time_function(OUT id smallint, OUT msg text) " + "RETURNS record AS "

src/test/java/org/zalando/typemapper/namedresult/DateTimeTestIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class DateTimeTestIT extends AbstractTest {
2222

2323
@Test
2424
public void testDateTimeMappings() throws SQLException {
25-
final PreparedStatement ps = connection.prepareStatement("SELECT lt, gt, zone from tmp.test_time");
25+
final PreparedStatement ps = connection.prepareStatement("SELECT (lt AT TIME ZONE 'UTC')::timestamp lt, gt, zone from tmp.test_time");
2626
final ResultSet rs = ps.executeQuery();
2727
final TypeMapper<?> mapper = TypeMapperFactory.createTypeMapper(ClassWithDateTime.class);
2828
int i = 0;

0 commit comments

Comments
 (0)