This post originated from an RSS feed registered with Ruby Buzz
by Matthew Bass.
Original Post: Drop seconds when querying MySQL timestamps
Feed Title: Pelargir
Feed URL: http://feeds.feedburner.com/pelargir/
Feed Description: Musings on software and life from Matthew Bass. Regular posts on new web products, tips and tricks, etc.
One of the Rails apps I’ve been working on formats times as HH:MM in the view. No seconds are displayed. This is a pretty common way to format things. When doing timestamp comparisons in SQL, however, the seconds are taken into account. This is bad since it can cause discrepancies in the view.
For example, say [...]