# Mathematical operations with dates on IBM I

**URL:** https://discourse.hibernate.org/t/mathematical-operations-with-dates-on-ibm-i/10951
**Category:** Hibernate ORM
**Created:** [January 29, 2025, 3:55am UTC](https://discourse.hibernate.org/t/mathematical-operations-with-dates-on-ibm-i/10951 "2025-01-29T03:55:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Radenixlol](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/radenixlol/32/3598_2.png) [@Radenixlol](https://discourse.hibernate.org/u/Radenixlol)
#### Post date: [January 29, 2025, 3:55am UTC](https://discourse.hibernate.org/t/mathematical-operations-with-dates-on-ibm-i/10951/1 "2025-01-29T03:55:46Z")

</div>

Hello, I wanted to know about how operations with dates are performed in JPQL, taking into account that I use IBM I, since I really don’t know if it is possible or not implemented, I really don’t know

---

<div class="post-metadata">

### Author: ![mbladel](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mbladel/32/2128_2.png) [@mbladel](https://discourse.hibernate.org/u/mbladel)
#### Post date: [January 29, 2025, 11:22am UTC](https://discourse.hibernate.org/t/mathematical-operations-with-dates-on-ibm-i/10951/2 "2025-01-29T11:22:12Z")

</div>

You can take a look at the implementation of arithmetic operations involving datetimes in any Hibernate dialect: here’s the [DB2iDialect](https://github.com/hibernate/hibernate-orm/blob/main/hibernate-core/src/main/java/org/hibernate/dialect/DB2iDialect.java), see e.g. `timestampaddPattern` and `timestampdiffPattern`.

You can also just test how these operations are performed yourself by using Hibernate and inspecting the generated SQL.

---

<div class="post-metadata">

### Author: ![Radenixlol](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/radenixlol/32/3598_2.png) [@Radenixlol](https://discourse.hibernate.org/u/Radenixlol)
#### Post date: [January 29, 2025, 9:15pm UTC](https://discourse.hibernate.org/t/mathematical-operations-with-dates-on-ibm-i/10951/3 "2025-01-29T21:15:58Z")

</div>

The problem is that you make functions that do not exist in that dialect, I just checked it with what you gave me, those functions are not implemented here

---

<div class="post-metadata">

### Author: ![Radenixlol](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/radenixlol/32/3598_2.png) [@Radenixlol](https://discourse.hibernate.org/u/Radenixlol)
#### Post date: [January 30, 2025, 6:59pm UTC](https://discourse.hibernate.org/t/mathematical-operations-with-dates-on-ibm-i/10951/5 "2025-01-30T18:59:37Z")

</div>

I just saw that since Db2i extends Db2, it acquires the implementation of the datediff that the other one has, I had not seen the extends that it had.
