<?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/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: Breaking &amp; Fixing Dates from MySQL to&#160;PHP</title> <atom:link href="http://davidwalsh.name/dates-mysql-php/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/dates-mysql-php</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Tue, 22 May 2012 05:31:04 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Maor</title><link>http://davidwalsh.name/dates-mysql-php#comment-15550</link> <dc:creator>Maor</dc:creator> <pubDate>Mon, 25 Jan 2010 04:03:17 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=776#comment-15550</guid> <description>There&#039;s another simple way to do that. I just posted something about it last week. The post itself in Hebrew, but you can still view the short code there and see..First way is to select from db using DATE_FORMAT functions.Second way is to format date with PHP on the returned date from DB.Heres&#039; the link -
http://www.maorb.info/tech/2010-01/format-date-php-mysqlYou may reply there in English if you want to.. :-)</description> <content:encoded><![CDATA[<p>There&#8217;s another simple way to do that. I just posted something about it last week. The post itself in Hebrew, but you can still view the short code there and see..</p><p>First way is to select from db using DATE_FORMAT functions.</p><p>Second way is to format date with PHP on the returned date from DB.</p><p>Heres&#8217; the link &#8211;<br
/> <a
href="http://www.maorb.info/tech/2010-01/format-date-php-mysql" rel="nofollow">http://www.maorb.info/tech/2010-01/format-date-php-mysql</a></p><p>You may reply there in English if you want to.. :-)</p> ]]></content:encoded> </item> <item><title>By: Eman</title><link>http://davidwalsh.name/dates-mysql-php#comment-14498</link> <dc:creator>Eman</dc:creator> <pubDate>Mon, 14 Dec 2009 16:28:43 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=776#comment-14498</guid> <description>I realize this is an older post, but I&#039;d like to add that (since php5) there is also the DateTime class, which lets you format the date similar to php&#039;s date function, like below, however I would suggest formatting date in Sql...
$datetime = new DateTime(&#039;2008-11-19&#039;); // (or database variable)
echo $datetime-&gt;format(&#039;D dS m, Y&#039;); // prints Wed 19th 11, 2008</description> <content:encoded><![CDATA[<p>I realize this is an older post, but I&#8217;d like to add that (since php5) there is also the DateTime class, which lets you format the date similar to php&#8217;s date function, like below, however I would suggest formatting date in Sql&#8230;<br
/> $datetime = new DateTime(&#8217;2008-11-19&#8242;); // (or database variable)<br
/> echo $datetime-&gt;format(&#8216;D dS m, Y&#8217;); // prints Wed 19th 11, 2008</p> ]]></content:encoded> </item> <item><title>By: torkil</title><link>http://davidwalsh.name/dates-mysql-php#comment-11954</link> <dc:creator>torkil</dc:creator> <pubDate>Fri, 18 Sep 2009 08:18:44 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=776#comment-11954</guid> <description>@Nagendra: Use the date_format function in MySQL to fetch the date on a different format. For instance:select date_format(date, &quot;%D %b %y&quot;) AS `formatted_date`This would convert the YYYY-MM-DD column &quot;date&quot; into your wanted formatting.</description> <content:encoded><![CDATA[<p>@Nagendra: Use the date_format function in MySQL to fetch the date on a different format. For instance:</p><p>select date_format(date, &#8220;%D %b %y&#8221;) AS `formatted_date`</p><p>This would convert the YYYY-MM-DD column &#8220;date&#8221; into your wanted formatting.</p> ]]></content:encoded> </item> <item><title>By: Nagendra</title><link>http://davidwalsh.name/dates-mysql-php#comment-11953</link> <dc:creator>Nagendra</dc:creator> <pubDate>Fri, 18 Sep 2009 07:22:19 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=776#comment-11953</guid> <description>I want to convert the date obtaining from the database(mysql) into another format(2009-09-18 into 18th Sep&#039;09) using php. Please help me.
Thanking you in advance,
Nagendra.</description> <content:encoded><![CDATA[<p>I want to convert the date obtaining from the database(mysql) into another format(2009-09-18 into 18th Sep&#8217;09) using php. Please help me.<br
/> Thanking you in advance,<br
/> Nagendra.</p> ]]></content:encoded> </item> <item><title>By: thanhquanky</title><link>http://davidwalsh.name/dates-mysql-php#comment-10272</link> <dc:creator>thanhquanky</dc:creator> <pubDate>Thu, 09 Jul 2009 19:30:47 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=776#comment-10272</guid> <description>@Doug:$old = strtotime($yourtime);
$new = date(&quot;F d, y&quot;,$old);</description> <content:encoded><![CDATA[<p>@Doug:</p><p>$old = strtotime($yourtime);<br
/> $new = date(&#8220;F d, y&#8221;,$old);</p> ]]></content:encoded> </item> <item><title>By: Doug</title><link>http://davidwalsh.name/dates-mysql-php#comment-9994</link> <dc:creator>Doug</dc:creator> <pubDate>Wed, 24 Jun 2009 22:58:33 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=776#comment-9994</guid> <description>Hi David,This really helped me out. Thanks a lot!Question:
First, I admit, I&#039;m a newbie at PHP and mySQL so maybe this question is a bit too naive for this post. Just wondering how to go from the new MM-DD-YYYY format to something like &quot;December 31, 07&quot;Would I do it in the function or inline in the output code somewhere? Thanks</description> <content:encoded><![CDATA[<p>Hi David,</p><p>This really helped me out. Thanks a lot!</p><p>Question:<br
/> First, I admit, I&#8217;m a newbie at PHP and mySQL so maybe this question is a bit too naive for this post. Just wondering how to go from the new MM-DD-YYYY format to something like &#8220;December 31, 07&#8243;</p><p>Would I do it in the function or inline in the output code somewhere? Thanks</p> ]]></content:encoded> </item> <item><title>By: mescript</title><link>http://davidwalsh.name/dates-mysql-php#comment-9792</link> <dc:creator>mescript</dc:creator> <pubDate>Mon, 15 Jun 2009 15:37:51 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=776#comment-9792</guid> <description>@Jay is best one</description> <content:encoded><![CDATA[<p>@Jay is best one</p> ]]></content:encoded> </item> <item><title>By: Wes</title><link>http://davidwalsh.name/dates-mysql-php#comment-7563</link> <dc:creator>Wes</dc:creator> <pubDate>Fri, 30 Jan 2009 00:13:46 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=776#comment-7563</guid> <description>In response to Mark&#039;s comment, you might want to look at the ISO standards to see why dates are stored in the format they are:
&lt;a href=&quot;http://en.wikipedia.org/wiki/ISO&#095;8601#Dates&quot; rel=&quot;nofollow&quot;&gt;Wikipedia article&lt;/a&gt;</description> <content:encoded><![CDATA[<p>In response to Mark&#8217;s comment, you might want to look at the ISO standards to see why dates are stored in the format they are:<br
/> <a
href="http://en.wikipedia.org/wiki/ISO&#95;8601#Dates" rel="nofollow">Wikipedia article</a></p> ]]></content:encoded> </item> <item><title>By: david</title><link>http://davidwalsh.name/dates-mysql-php#comment-3978</link> <dc:creator>david</dc:creator> <pubDate>Thu, 27 Nov 2008 15:23:20 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=776#comment-3978</guid> <description>&lt;p&gt;@Jay:  Nice script, but you&#039;re missing &quot;)&quot;&#039;s at the end of each strtotime() to close the date function.&lt;/p&gt;</description> <content:encoded><![CDATA[<p>@Jay:  Nice script, but you&#8217;re missing &#8220;)&#8221;&#8216;s at the end of each strtotime() to close the date function.</p> ]]></content:encoded> </item> <item><title>By: Jay Salvat</title><link>http://davidwalsh.name/dates-mysql-php#comment-3977</link> <dc:creator>Jay Salvat</dc:creator> <pubDate>Thu, 27 Nov 2008 14:57:10 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=776#comment-3977</guid> <description>Hi David,
The simpliest way is the strtotime way.function break_date($date)
{
return date(&#039;Y-m-d&#039;, strtotime($date);
}function fix_date($date)
{
return date(&#039;m/d/Y&#039;, strtotime($date);
}</description> <content:encoded><![CDATA[<p>Hi David,<br
/> The simpliest way is the strtotime way.</p><p>function break_date($date)<br
/> {<br
/> return date(&#8216;Y-m-d&#8217;, strtotime($date);<br
/> }</p><p>function fix_date($date)<br
/> {<br
/> return date(&#8216;m/d/Y&#8217;, strtotime($date);<br
/> }</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 3/7 queries in 0.009 seconds using disk: basic
Object Caching 805/805 objects using disk: basic

Served from: davidwalsh.name @ 2012-05-22 04:14:59 -->
