Mysql Functions CONVERT_TZ()

7 views
Skip to first unread message

Sheldon D'Souza

unread,
Sep 26, 2016, 7:00:26 AM9/26/16
to jOOQ User Group
We need to do some time zone conversions on client side, wanted to know how the mysql CONVERT_TZ() function can be used in the select.

Lukas Eder

unread,
Sep 26, 2016, 4:40:02 PM9/26/16
to jooq...@googlegroups.com
Hi Sheldon,

Right now, jOOQ doesn't have out-of-the-box support for that function, but you can easily build support yourself by using jOOQ's plain SQL API. See:

For example:

public static Field<String> convertTz(Field<String> ts, String from, String to) {
    return DSL.field("convert_tz({0}, {1}, {2})", String.class, ts, DSL.val(from), DSL.val(to));
}

Hope this helps,
Lukas

2016-09-26 13:00 GMT+02:00 Sheldon D'Souza <she...@sminq.com>:
We need to do some time zone conversions on client side, wanted to know how the mysql CONVERT_TZ() function can be used in the select.

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages