I'm doing a project in ruby (no rails) using the mysql2 gem for my mysql database connection. I have some datetime fields in my tables.
The problem is this. In most cases where the mysql datetime fields are "reasonable" (I think that means, prior to Jan 2038?), the mysql2 gem returns ruby Time values. However, when the dates are outside of that range, the mysql2 gem happens to return a DateTime value, which took me by surprise at first (since my code had assumed I'd get a Time object like usual). This obviously causes issues when doing comparisons to Time.now/DateTime.now etc since I end up with class mismatches occasionally and unpredictably. Has anyone dealt with this before? If so, is there a reasonably clean/elegant/transparent way of coping? Thanks... -glenn -- SD Ruby mailing list [email protected] http://groups.google.com/group/sdruby
