<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Drop seconds when querying MySQL timestamps</title>
	<atom:link href="http://matthewbass.com/2010/06/25/drop-seconds-when-querying-mysql-timestamps/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthewbass.com/2010/06/25/drop-seconds-when-querying-mysql-timestamps/</link>
	<description>Musings on software and life...</description>
	<lastBuildDate>Sat, 25 Feb 2012 01:12:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gilson</title>
		<link>http://matthewbass.com/2010/06/25/drop-seconds-when-querying-mysql-timestamps/comment-page-1/#comment-31253</link>
		<dc:creator>Gilson</dc:creator>
		<pubDate>Tue, 29 Jun 2010 06:26:06 +0000</pubDate>
		<guid isPermaLink="false">http://matthewbass.com/?p=600#comment-31253</guid>
		<description>This might do the trick.
&lt;code&gt;
def end_of_minute(time)
  time += 59 - time.sec
end
&lt;/code&gt;
or this if you want to use the &quot;&lt;&quot; instead &quot;&lt;=&quot;
&lt;code&gt;
def next_minute(time)
  time += 60 - time.sec
end
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>This might do the trick.<br />
<code><br />
def end_of_minute(time)<br />
  time += 59 - time.sec<br />
end<br />
</code><br />
or this if you want to use the &#8220;&lt;&quot; instead &quot;&lt;=&quot;<br />
<code><br />
def next_minute(time)<br />
  time += 60 - time.sec<br />
end<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Bass</title>
		<link>http://matthewbass.com/2010/06/25/drop-seconds-when-querying-mysql-timestamps/comment-page-1/#comment-31248</link>
		<dc:creator>Matthew Bass</dc:creator>
		<pubDate>Mon, 28 Jun 2010 13:21:16 +0000</pubDate>
		<guid isPermaLink="false">http://matthewbass.com/?p=600#comment-31248</guid>
		<description>Alex, yes, it should work for minutes, hours... any unit that can be extracted from a timestamp with a MySQL function.

Paul, querying for a minute ahead is a good idea, but the time I&#039;m passing to the query isn&#039;t static... it&#039;s the current time. So I would need to perform some sort of calculation to determine if the current time is within 15:00:00 to 15:00:59 and add 1 minute if it was.</description>
		<content:encoded><![CDATA[<p>Alex, yes, it should work for minutes, hours&#8230; any unit that can be extracted from a timestamp with a MySQL function.</p>
<p>Paul, querying for a minute ahead is a good idea, but the time I&#8217;m passing to the query isn&#8217;t static&#8230; it&#8217;s the current time. So I would need to perform some sort of calculation to determine if the current time is within 15:00:00 to 15:00:59 and add 1 minute if it was.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Barry</title>
		<link>http://matthewbass.com/2010/06/25/drop-seconds-when-querying-mysql-timestamps/comment-page-1/#comment-31213</link>
		<dc:creator>Paul Barry</dc:creator>
		<pubDate>Fri, 25 Jun 2010 22:18:47 +0000</pubDate>
		<guid isPermaLink="false">http://matthewbass.com/?p=600#comment-31213</guid>
		<description>This is going to be slow because you won&#039;t be able to use an index on created_at. Why not just query for select * from records where created_at &lt; &#039;2010-06-25 15:01:00&#039;?</description>
		<content:encoded><![CDATA[<p>This is going to be slow because you won&#8217;t be able to use an index on created_at. Why not just query for select * from records where created_at &lt; &#039;2010-06-25 15:01:00&#039;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://matthewbass.com/2010/06/25/drop-seconds-when-querying-mysql-timestamps/comment-page-1/#comment-31212</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 25 Jun 2010 22:04:07 +0000</pubDate>
		<guid isPermaLink="false">http://matthewbass.com/?p=600#comment-31212</guid>
		<description>Good idea, i guess it works with minutes, hours etc. the same way ? )</description>
		<content:encoded><![CDATA[<p>Good idea, i guess it works with minutes, hours etc. the same way ? )</p>
]]></content:encoded>
	</item>
</channel>
</rss>

