TIMESTAMPDIFF function

273 views
Skip to first unread message

Alza

unread,
Apr 18, 2010, 11:58:36 AM4/18/10
to H2 Database
Hi there,

I am trying to keep portability between H2 and MySQL and I would also
like to use the TIMESTAMPDIFF function. Does H2 support this function?

Thanks

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Thomas Mueller

unread,
Apr 20, 2010, 3:33:46 PM4/20/10
to h2-da...@googlegroups.com
Hi,

> I am trying to keep portability between H2 and MySQL and I would also
> like to use the TIMESTAMPDIFF function. Does H2 support this function?

I found a link:
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timestampdiff

H2 currently doesn't support it. Unfortunately, it's not possible to
emulate it using a user defined function because the first parameter
is not in quotes. But according to my tests, TIMESTAMPDIFF exactly
matches the H2 system function DATEDIFF. I will make it an alias, so
TIMESTAMPDIFF will be supported starting with the next release.

Regards,
Thomas
Reply all
Reply to author
Forward
0 new messages