<?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: Convert American date format to European and vice versa</title>
	<atom:link href="http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/</link>
	<description>CSS Toys for Professional Web Developers</description>
	<lastBuildDate>Sat, 03 Dec 2011 21:05:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: Myles</title>
		<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/comment-page-1/#comment-31260</link>
		<dc:creator>Myles</dc:creator>
		<pubDate>Thu, 12 May 2011 13:47:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/#comment-31260</guid>
		<description>It isn&#039;t european date, it is english date, euro dates are

Y/M/D

for their sins.</description>
		<content:encoded><![CDATA[<p>It isn&#8217;t european date, it is english date, euro dates are</p>
<p>Y/M/D</p>
<p>for their sins.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George Mitchell</title>
		<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/comment-page-1/#comment-31232</link>
		<dc:creator>George Mitchell</dc:creator>
		<pubDate>Mon, 14 Feb 2011 18:41:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/#comment-31232</guid>
		<description>Here&#039;s a date function that works for me.
European format to American

function e2aDate($strDate) {
	trim($strDate);
	list($d, $m, $y) = explode(&#039;/&#039;, $strDate);
	$mk = mktime(0,0,0,$m, $d, $y);
	$americanDate =strftime(&#039;%Y-%m-%d&#039;,$mk);
	
	return $americanDate;
}
$aDate=e2aDate(&quot;10/02/2011&quot;);   //call the function pass date
$aDate would be set to 2011-02-10

OR 
American to European

function a2eDate($strDate) {
	trim($strDate);
	list($y, $m, $d) = explode(&#039;-&#039;, $strDate);
	$mk = mktime(0,0,0,$m, $d, $y);
	$europeanDate =strftime(&#039;%d/%m/%Y&#039;,$mk);

	return $europeanDate;
}
$aDate=a2eDate(&quot;02/10/2011&quot;);   //call the function pass date
$aDate would be set to 10/02/2011

change the strftime(&#039;%d/%m/%Y&#039;,$mk);  %d %m %y positions to give correct format.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a date function that works for me.<br />
European format to American</p>
<p>function e2aDate($strDate) {<br />
	trim($strDate);<br />
	list($d, $m, $y) = explode(&#8216;/&#8217;, $strDate);<br />
	$mk = mktime(0,0,0,$m, $d, $y);<br />
	$americanDate =strftime(&#8216;%Y-%m-%d&#8217;,$mk);</p>
<p>	return $americanDate;<br />
}<br />
$aDate=e2aDate(&#8220;10/02/2011&#8243;);   //call the function pass date<br />
$aDate would be set to 2011-02-10</p>
<p>OR<br />
American to European</p>
<p>function a2eDate($strDate) {<br />
	trim($strDate);<br />
	list($y, $m, $d) = explode(&#8216;-&#8217;, $strDate);<br />
	$mk = mktime(0,0,0,$m, $d, $y);<br />
	$europeanDate =strftime(&#8216;%d/%m/%Y&#8217;,$mk);</p>
<p>	return $europeanDate;<br />
}<br />
$aDate=a2eDate(&#8220;02/10/2011&#8243;);   //call the function pass date<br />
$aDate would be set to 10/02/2011</p>
<p>change the strftime(&#8216;%d/%m/%Y&#8217;,$mk);  %d %m %y positions to give correct format.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mo</title>
		<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/comment-page-1/#comment-31021</link>
		<dc:creator>mo</dc:creator>
		<pubDate>Sun, 02 May 2010 08:20:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/#comment-31021</guid>
		<description>$date=&#039;12/31/2006&#039;;  
$date = explode (&#039;/&#039;,$date);  
echo $date[1].&#039;/&#039;.$date[0]./.$date[2];</description>
		<content:encoded><![CDATA[<p>$date=&#8217;12/31/2006&#8242;;<br />
$date = explode (&#8216;/&#8217;,$date);<br />
echo $date[1].&#8217;/&#8217;.$date[0]./.$date[2];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted</title>
		<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/comment-page-1/#comment-30168</link>
		<dc:creator>Ted</dc:creator>
		<pubDate>Thu, 27 Nov 2008 08:19:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/#comment-30168</guid>
		<description>I originally posted this script as a reminder. I wanted to go back and look at it if needed in the future. At the time, I didn&#039;t know much about php or regex. So I&#039;m sorry if it doesn&#039;t work.

I would agree with Justin. If I were to do it today, i&#039;d probably convert to unix time stamp and then use the built in date formatting options in PHP. But that is because I dislike regex and the date formatting in PHP is much easier to understand.

However, the point of this snippet is to change from US dates to EU and vice versa. Using the built in php date formatting is only one way. You&#039;d have to localize it for each region.</description>
		<content:encoded><![CDATA[<p>I originally posted this script as a reminder. I wanted to go back and look at it if needed in the future. At the time, I didn&#8217;t know much about php or regex. So I&#8217;m sorry if it doesn&#8217;t work.</p>
<p>I would agree with Justin. If I were to do it today, i&#8217;d probably convert to unix time stamp and then use the built in date formatting options in PHP. But that is because I dislike regex and the date formatting in PHP is much easier to understand.</p>
<p>However, the point of this snippet is to change from US dates to EU and vice versa. Using the built in php date formatting is only one way. You&#8217;d have to localize it for each region.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Sainton</title>
		<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/comment-page-1/#comment-30167</link>
		<dc:creator>Justin Sainton</dc:creator>
		<pubDate>Wed, 26 Nov 2008 21:36:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/#comment-30167</guid>
		<description>Much simpler and more consistent results by using echo date( &#039;m-d-Y&#039;, strtotime( $date) )</description>
		<content:encoded><![CDATA[<p>Much simpler and more consistent results by using echo date( &#8216;m-d-Y&#8217;, strtotime( $date) )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger</title>
		<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/comment-page-1/#comment-30147</link>
		<dc:creator>Roger</dc:creator>
		<pubDate>Thu, 20 Nov 2008 14:44:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/#comment-30147</guid>
		<description>Agreed, this example simply doesn&#039;t work unless there is something about the PHP environment that needs setting which has not been given here?</description>
		<content:encoded><![CDATA[<p>Agreed, this example simply doesn&#8217;t work unless there is something about the PHP environment that needs setting which has not been given here?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nope</title>
		<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/comment-page-1/#comment-30095</link>
		<dc:creator>Nope</dc:creator>
		<pubDate>Mon, 10 Nov 2008 12:57:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/#comment-30095</guid>
		<description>Saved the above into a .php file and ran it, does nothing except output the date as it was. 
useless.</description>
		<content:encoded><![CDATA[<p>Saved the above into a .php file and ran it, does nothing except output the date as it was.<br />
useless.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Life of Matt Campos &#187; Blog Archive &#187; PHP - Convert American to European Date Format</title>
		<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/comment-page-1/#comment-27607</link>
		<dc:creator>The Life of Matt Campos &#187; Blog Archive &#187; PHP - Convert American to European Date Format</dc:creator>
		<pubDate>Wed, 17 Oct 2007 17:31:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/#comment-27607</guid>
		<description>[...] Thanks to last-child.com for the Snippet. [...]</description>
		<content:encoded><![CDATA[<p>[...] Thanks to last-child.com for the Snippet. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHP - Convert American to European Date Format at GraysUnderground.com</title>
		<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/comment-page-1/#comment-27604</link>
		<dc:creator>PHP - Convert American to European Date Format at GraysUnderground.com</dc:creator>
		<pubDate>Tue, 16 Oct 2007 14:38:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/#comment-27604</guid>
		<description>[...] Thanks to last-child.com for the Snippet. [...]</description>
		<content:encoded><![CDATA[<p>[...] Thanks to last-child.com for the Snippet. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/comment-page-1/#comment-27536</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 20 Sep 2007 18:39:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.last-child.com/convert-american-date-format-to-european-and-vice-versa/#comment-27536</guid>
		<description>Awesome!  Although I used $3-$1-$2 (instead of the \\ notation)</description>
		<content:encoded><![CDATA[<p>Awesome!  Although I used $3-$1-$2 (instead of the \\ notation)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

