Timezone conversion in queries

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Timezone conversion in queries

Midhun Nair
I have a Mapper "MessageResulMapper.xml" which actually fetches some rows from the Oracle DB.

The columns also include some of the Timestamp fields. In the database the value of this Dthis field is stored in EST, is there a way I can do a conversion from EST to say Asia timezone while fetching the results in mybatis side rather than wrapping the resultSet and then passing it to a service which converts these DateTime field to desired timezone.

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/8464effb-ef58-42ad-bbbf-b4959866d71ao%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Timezone conversion in queries

Guy Rouillier-2
Oracle has the ability to do that; I found some examples here:


If you'd prefer to do it in Java code, then add the appropriate logic to the getter method for that property.

On Mon, 2020-06-22 at 14:47 -0700, Midhun Nair wrote:
I have a Mapper "MessageResulMapper.xml" which actually fetches some rows from the Oracle DB. 

The columns also include some of the Timestamp fields. In the database the value of this Dthis field is stored in EST, is there a way I can do a conversion from EST to say Asia timezone while fetching the results in mybatis side rather than wrapping the resultSet and then passing it to a service which converts these DateTime field to desired timezone.

Thanks in advance.

-- 
--
Guy Rouillier

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/fa13161122f5c7283aaa213964190a2964e64c66.camel%40gmail.com.