<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Webmaster Sucks &#187; date calculation</title>
	<atom:link href="http://www.webmastersucks.com/tags/date-calculation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webmastersucks.com</link>
	<description>Here I share stuff I used to suck at as a novice webmaster..</description>
	<lastBuildDate>Mon, 13 Jun 2011 06:39:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Grouping Date with Datetime in MySQL</title>
		<link>http://www.webmastersucks.com/grouping-date-with-datetime-in-mysql/</link>
		<comments>http://www.webmastersucks.com/grouping-date-with-datetime-in-mysql/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 11:17:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[date calculation]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[date_format]]></category>
		<category><![CDATA[grouping date]]></category>
		<category><![CDATA[grouping date datetime]]></category>
		<category><![CDATA[grouping date mysql]]></category>

		<guid isPermaLink="false">http://www.webmastersucks.com/?p=261</guid>
		<description><![CDATA[
			
				
			
		
This is very basic and very useful command for mysql. I need user registration date by date. Firstly, i calculate with PHP, after i think it must be a basic way. I found this mysql command. I hope you&#8217;ll enjoy.

SELECT DATE_FORMAT(registerdate, '%Y-%m-%d') AS dd, COUNT(id) as TotalUser FROM UserTable GROUP BY dd;

]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webmastersucks.com%2Fgrouping-date-with-datetime-in-mysql%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webmastersucks.com%2Fgrouping-date-with-datetime-in-mysql%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This is very basic and very useful command for mysql. I need user registration date by date. Firstly, i calculate with PHP, after i think it must be a basic way. I found this mysql command. I hope you&#8217;ll enjoy.</p>
<pre class="brush: php; title: ;">
SELECT DATE_FORMAT(registerdate, '%Y-%m-%d') AS dd, COUNT(id) as TotalUser FROM UserTable GROUP BY dd;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.webmastersucks.com/grouping-date-with-datetime-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculate Last Week, Last Month in Mysql</title>
		<link>http://www.webmastersucks.com/calculate-last-week-last-month-in-mysql/</link>
		<comments>http://www.webmastersucks.com/calculate-last-week-last-month-in-mysql/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 07:49:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[curdate]]></category>
		<category><![CDATA[current date]]></category>
		<category><![CDATA[date calculation]]></category>
		<category><![CDATA[date_add]]></category>
		<category><![CDATA[last month]]></category>
		<category><![CDATA[last week]]></category>
		<category><![CDATA[yesterday]]></category>

		<guid isPermaLink="false">http://www.webmastersucks.com/?p=52</guid>
		<description><![CDATA[
			
				
			
		
We need get datas from last week, last month, yesterday and today. We can do it easily in MySQL.
Getting Current Date
SELECT CURDATE();
Result : 2009-06-04
Getting Last Week Datas
SELECT DATE_ADD('2009-06-04', INTERVAL 7 DAY);
Getting Last Month Datas
SELECT DATE_ADD('2009-06-04', 1 MONTH);
Getting Last Year Datas
SELECT DATE_ADD('2009-06-04', INTERVAL 1 YEAR);
And Php example for this calculations, getting last month orders
mysql_query(&#34;SELECT * FROM [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webmastersucks.com%2Fcalculate-last-week-last-month-in-mysql%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webmastersucks.com%2Fcalculate-last-week-last-month-in-mysql%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We need get datas from last week, last month, yesterday and today. We can do it easily in MySQL.</p>
<p><strong>Getting Current Date</strong></p>
<pre class="brush: plain; title: ;">SELECT CURDATE();</pre>
<p><strong>Result :</strong> 2009-06-04</p>
<p><strong>Getting Last Week Datas</strong></p>
<pre class="brush: plain; title: ;">SELECT DATE_ADD('2009-06-04', INTERVAL 7 DAY);</pre>
<p><strong>Getting Last Month Datas</strong></p>
<pre class="brush: plain; title: ;">SELECT DATE_ADD('2009-06-04', 1 MONTH);</pre>
<p><strong>Getting Last Year Datas</strong></p>
<pre class="brush: plain; title: ;">SELECT DATE_ADD('2009-06-04', INTERVAL 1 YEAR);</pre>
<p>And Php example for this calculations, getting last month orders</p>
<pre class="brush: php; title: ;">mysql_query(&quot;SELECT * FROM orders WHERE DATE_SUB(CURDATE(),INTERVAL 1 month) &lt;= order_date&quot;)); </pre>
<p>For more information of Date and time functions :<br />
<a href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html">http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webmastersucks.com/calculate-last-week-last-month-in-mysql/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

