Skip to content

Commit

Permalink
assertions for extract(offset hour/minute)
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin King <gavin@hibernate.org>
  • Loading branch information
gavinking committed May 2, 2024
1 parent a90b1a2 commit 2140de0
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,21 @@ public void testExtractFunctionTimeZone(SessionFactoryScope scope) {
);
}

@Test
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsTimezoneTypes.class)
public void testExtractOffsetHourMinute(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
assertEquals(3,
session.createQuery("select extract(offset hour from offset datetime 2024-2-5 12:30:12+03:12)", Integer.class)
.getSingleResult());
assertEquals(12,
session.createQuery("select extract(offset minute from offset datetime 2024-2-5 12:30:12+03:12)", Integer.class)
.getSingleResult());
}
);
}

@Test
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsTimezoneTypes.class)
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsFormat.class, comment = "We extract the offset with a format function")
Expand Down

0 comments on commit 2140de0

Please sign in to comment.