I was just dealing with this issue the other day!

My solution was to have PHP re-parse the dates to always be exactly at midnight of their respective day (so that the extra time info wouldn't affect sorting), and then when the dates are displayed my format string only includes date info... So yeah, manually. But they're still indexed as a date type. My only real issue with this was that dates were in EST, but indexed in UTC... So before rounding we added 5 hours to every date to compensate.

--
Steve

On Aug 28, 2008, at 11:31 AM, Otis Gospodnetic wrote:

Hi,

How do people tend to round date type fields when they don't need millisecond precision?

Using just the straight "date" type leaves you with date/time info down to milliseconds. What if you want to round that up to minutes, for example? Is there a way to tell the "date" type to do that? Or do people simply round dates manually before indexing and then index them not as "date" type, but as "string" type, for example: "2008-08-28 23:30"?


Thanks,
Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch


Reply via email to