mySQL result problems with dates

When I dump a result set from a mysql query, all the DateTime dates are actual objects, instead of the actual date.

This is what I see:
“object of java.time.LocalDateTime”

This happens to DateTime types, but not TimeStamp. Also, this happens only with CommandBox. When running same page with Adobe Coldfusion, everything looks fine. Any help is appreciated. Thanks!

Felix, this is indeed not a commandbox problem. It DOES happen with ACF. But it only happens if the mysql jdbc driver version is greater than 8.0.22. So if you checked your ACF install (the cfusion/lib folder, or [instance]/lib folder), you may see it has an older one, while commandbox is using a newer one. So my point is that if you upgraded your CF to a newer mysql jar (the latest is 8.0.29), you’d see the same problem there also.

And Adobe has been informed of the issue (tracker tickets Tracker and Tracker). The fixes offered so far have not helped me and folks I am helping with this problem.

Until they do, most folks are backing their mysql jdbc driver to 8.0.22 or earlier. I will leave it to others to propose what may be the best way to do that with commandbox.

2 Likes

Thank you. And yes, after I posted this, I came across a few blogs about it, one might have been yours actually.

I was able to replace the driver with an older version and the dates are correct now.