<?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>Комментарии к записи: Преобразование даты MySQL в общепринятый (человеческий) формат</title>
	<atom:link href="http://dimoning.ru/mysql-date-to-normal.html/feed" rel="self" type="application/rss+xml" />
	<link>http://dimoning.ru/mysql-date-to-normal.html</link>
	<description>программирование сайтов и скриптов</description>
	<lastBuildDate>Sun, 05 Feb 2012 13:44:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Автор: Alexey</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-60640</link>
		<dc:creator>Alexey</dc:creator>
		<pubDate>Thu, 04 Aug 2011 12:07:43 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-60640</guid>
		<description>Спасибо! То что надо.</description>
		<content:encoded><![CDATA[<p>Спасибо! То что надо.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: enforc1k</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-52890</link>
		<dc:creator>enforc1k</dc:creator>
		<pubDate>Sat, 21 May 2011 09:04:45 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-52890</guid>
		<description>Автору респект! Так долго искал нужное решение, пол инета перерыл, в основном все описывают конверт из timestamp.

СПАСИБО ОГРОМНОЕ!</description>
		<content:encoded><![CDATA[<p>Автору респект! Так долго искал нужное решение, пол инета перерыл, в основном все описывают конверт из timestamp.</p>
<p>СПАСИБО ОГРОМНОЕ!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Den</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-46019</link>
		<dc:creator>Den</dc:creator>
		<pubDate>Sun, 13 Feb 2011 09:30:41 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-46019</guid>
		<description>Thanks =)</description>
		<content:encoded><![CDATA[<p>Thanks =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: MG</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-45510</link>
		<dc:creator>MG</dc:creator>
		<pubDate>Tue, 01 Feb 2011 17:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-45510</guid>
		<description>Отличный пример того, как не надо делать )))
учим SQL date_format
да и в php есть готовые функции.</description>
		<content:encoded><![CDATA[<p>Отличный пример того, как не надо делать )))<br />
учим SQL date_format<br />
да и в php есть готовые функции.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Aube</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-44570</link>
		<dc:creator>Aube</dc:creator>
		<pubDate>Thu, 30 Dec 2010 02:20:17 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-44570</guid>
		<description>Отличный пример говнокода! Спасибо!</description>
		<content:encoded><![CDATA[<p>Отличный пример говнокода! Спасибо!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Marik</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-43943</link>
		<dc:creator>Marik</dc:creator>
		<pubDate>Tue, 08 Jun 2010 16:33:03 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-43943</guid>
		<description>Спасибо. Полезный сайт. Хороший рабочий скрипт.
С уважением.</description>
		<content:encoded><![CDATA[<p>Спасибо. Полезный сайт. Хороший рабочий скрипт.<br />
С уважением.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: 6ypaTuHo</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-41423</link>
		<dc:creator>6ypaTuHo</dc:creator>
		<pubDate>Thu, 01 Apr 2010 09:35:17 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-41423</guid>
		<description>Большое спасибо! Все здорово получилось!</description>
		<content:encoded><![CDATA[<p>Большое спасибо! Все здорово получилось!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: ftr404</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-40288</link>
		<dc:creator>ftr404</dc:creator>
		<pubDate>Wed, 17 Mar 2010 12:02:04 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-40288</guid>
		<description>&gt;&gt;А при таком запросе?
&gt;&gt;mysql_query(”SELECT * FROM tbl_1 WHERE id_tbl_2 = 
&gt;&gt;$id_tbl_2?)

mysql_query(”SELECT *,date_format(datetime,’%d.%m.%Y’)as date_normal FROM tbl_1 WHERE id_tbl_2 = $id_tbl_2?)</description>
		<content:encoded><![CDATA[<p>&gt;&gt;А при таком запросе?<br />
&gt;&gt;mysql_query(”SELECT * FROM tbl_1 WHERE id_tbl_2 =<br />
&gt;&gt;$id_tbl_2?)</p>
<p>mysql_query(”SELECT *,date_format(datetime,’%d.%m.%Y’)as date_normal FROM tbl_1 WHERE id_tbl_2 = $id_tbl_2?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: SETTER</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-38064</link>
		<dc:creator>SETTER</dc:creator>
		<pubDate>Tue, 26 Jan 2010 20:23:19 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-38064</guid>
		<description>http://lphp.ru/?id_article=165</description>
		<content:encoded><![CDATA[<p><a href="http://lphp.ru/?id_article=165" rel="nofollow">http://lphp.ru/?id_article=165</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: SETTER</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-34517</link>
		<dc:creator>SETTER</dc:creator>
		<pubDate>Fri, 30 Oct 2009 21:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-34517</guid>
		<description>А при таком запросе?
mysql_query(&quot;SELECT * FROM tbl_1 WHERE id_tbl_2 =  $id_tbl_2&quot;)

 Как вот это использовать? 
select date_format(datetime,’%d.%m.%Y’) from table;</description>
		<content:encoded><![CDATA[<p>А при таком запросе?<br />
mysql_query(&laquo;SELECT * FROM tbl_1 WHERE id_tbl_2 =  $id_tbl_2&#8243;)</p>
<p> Как вот это использовать?<br />
select date_format(datetime,’%d.%m.%Y’) from table;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: art</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-22971</link>
		<dc:creator>art</dc:creator>
		<pubDate>Fri, 17 Apr 2009 20:58:49 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-22971</guid>
		<description>MySQL с этим прекрасно справляется:
select date_format(datetime,&#039;%d.%m.%Y&#039;) from table;</description>
		<content:encoded><![CDATA[<p>MySQL с этим прекрасно справляется:<br />
select date_format(datetime,&#8217;%d.%m.%Y&#8217;) from table;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: xcopy</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-22641</link>
		<dc:creator>xcopy</dc:creator>
		<pubDate>Tue, 14 Apr 2009 11:46:03 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-22641</guid>
		<description>$time = strtotime(&#039;2009-04-23 15:28:26&#039;);
   $month = array(1=&gt;&quot;января&quot;, 2=&gt;&quot;февраля&quot;, 3=&gt;&quot;марта&quot;, 4=&gt;&quot;апреля&quot;, 5=&gt;&quot;мая&quot;, 6=&gt;&quot;июня&quot;, 7=&gt;&quot;июля&quot;, 8=&gt;&quot;августа&quot;, 9=&gt;&quot;сентября&quot;, 10=&gt;&quot;октября&quot;, 11=&gt;&quot;ноября&quot;, 12=&gt;&quot;декабря&quot;);
   $int_month = date(&#039;n&#039;, $time);
   $date = date(&#039;\%\s d \%\s Y, \%\s H:i:s&#039;, $time);
   echo sprintf($date, &#039;Сегодня:&#039;, $month[$int_month], &#039;время:&#039;);</description>
		<content:encoded><![CDATA[<p>$time = strtotime(&#8216;2009-04-23 15:28:26&#8242;);<br />
   $month = array(1=&gt;&raquo;января&raquo;, 2=&gt;&raquo;февраля&raquo;, 3=&gt;&raquo;марта&raquo;, 4=&gt;&raquo;апреля&raquo;, 5=&gt;&raquo;мая&raquo;, 6=&gt;&raquo;июня&raquo;, 7=&gt;&raquo;июля&raquo;, 8=&gt;&raquo;августа&raquo;, 9=&gt;&raquo;сентября&raquo;, 10=&gt;&raquo;октября&raquo;, 11=&gt;&raquo;ноября&raquo;, 12=&gt;&raquo;декабря&raquo;);<br />
   $int_month = date(&#8216;n&#8217;, $time);<br />
   $date = date(&#8216;\%\s d \%\s Y, \%\s H:i:s&#8217;, $time);<br />
   echo sprintf($date, &#8216;Сегодня:&#8217;, $month[$int_month], &#8216;время:&#8217;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Alex</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-21422</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 26 Mar 2009 13:21:26 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-21422</guid>
		<description>strtotime и date вам в помощь</description>
		<content:encoded><![CDATA[<p>strtotime и date вам в помощь</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: merlin</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-2734</link>
		<dc:creator>merlin</dc:creator>
		<pubDate>Tue, 30 Sep 2008 14:14:26 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-2734</guid>
		<description>Зачем преобразовывать дату в php? В mysql уже есть функция DATE_FORMAT, можно ее использовать непосредственно в SQL запросе и получить дату в нужном нам формате.</description>
		<content:encoded><![CDATA[<p>Зачем преобразовывать дату в php? В mysql уже есть функция DATE_FORMAT, можно ее использовать непосредственно в SQL запросе и получить дату в нужном нам формате.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: mikaxxl</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-2382</link>
		<dc:creator>mikaxxl</dc:creator>
		<pubDate>Tue, 23 Sep 2008 13:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-2382</guid>
		<description>Извените немного ошибся в строке
if ($year == 1) {$result .= $ymd[2]; $result .= ” “.$month[$ymd[1]]; $result .= ” “.$ymd[0];}
Чтобы отображались все месяцы необходимо писать так
if ($year == 1) {$result .= $ymd[2]; $result .= &quot; &quot;.$month[(int)$ymd[1]]; $result .= &quot; &quot;.$ymd[0];}</description>
		<content:encoded><![CDATA[<p>Извените немного ошибся в строке<br />
if ($year == 1) {$result .= $ymd[2]; $result .= ” “.$month[$ymd[1]]; $result .= ” “.$ymd[0];}<br />
Чтобы отображались все месяцы необходимо писать так<br />
if ($year == 1) {$result .= $ymd[2]; $result .= &raquo; &laquo;.$month[(int)$ymd[1]]; $result .= &raquo; &laquo;.$ymd[0];}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Серега)</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-2270</link>
		<dc:creator>Серега)</dc:creator>
		<pubDate>Sat, 20 Sep 2008 21:46:54 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-2270</guid>
		<description>Спасибо всем)</description>
		<content:encoded><![CDATA[<p>Спасибо всем)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: mikaxxl</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-1975</link>
		<dc:creator>mikaxxl</dc:creator>
		<pubDate>Sun, 14 Sep 2008 06:24:46 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-1975</guid>
		<description>Немного подправил фунцию для вывода в формте дд месяц uuuu

function data_convert ($data, $year=1, $time=0, $second=0){
$month = array (&quot;&quot;, &quot;Января&quot;, &quot;Февраля&quot;, &quot;Марта&quot;, &quot;Апреля&quot;, &quot;Мая&quot;, &quot;Июня&quot;, &quot;Июля&quot;, &quot;Августа&quot;, &quot;Сентября&quot;, &quot;Октября&quot;, &quot;Ноября&quot;, &quot;Декабря&quot;);
$result = &quot;&quot;;
$part = explode(&quot; &quot; , $data);
$ymd = explode (&quot;-&quot;, $part[0]);
if (isset($part[1])) $hms = explode (&quot;:&quot;, $part[1]);
if ($year == 1) {$result .= $ymd[2]; $result .= &quot; &quot;.$month[$ymd[1]]; $result .= &quot; &quot;.$ymd[0];}
if ($time == 1) {$result .= &quot; &quot;.$hms[0]; $result .= &quot;:&quot;.$hms[1]; if ($second == 1) $result .= &quot;:&quot;.$hms[2];}
return $result;
}
echo $myrow[&#039;burn_date&#039;] = data_convert($myrow[&#039;burn_date&#039;])

в результате выведет в таком формате: 12 Декабря 1970</description>
		<content:encoded><![CDATA[<p>Немного подправил фунцию для вывода в формте дд месяц uuuu</p>
<p>function data_convert ($data, $year=1, $time=0, $second=0){<br />
$month = array (&laquo;&raquo;, &laquo;Января&raquo;, &laquo;Февраля&raquo;, &laquo;Марта&raquo;, &laquo;Апреля&raquo;, &laquo;Мая&raquo;, &laquo;Июня&raquo;, &laquo;Июля&raquo;, &laquo;Августа&raquo;, &laquo;Сентября&raquo;, &laquo;Октября&raquo;, &laquo;Ноября&raquo;, &laquo;Декабря&raquo;);<br />
$result = &laquo;&raquo;;<br />
$part = explode(&raquo; &raquo; , $data);<br />
$ymd = explode (&laquo;-&raquo;, $part[0]);<br />
if (isset($part[1])) $hms = explode (&laquo;:&raquo;, $part[1]);<br />
if ($year == 1) {$result .= $ymd[2]; $result .= &raquo; &laquo;.$month[$ymd[1]]; $result .= &raquo; &laquo;.$ymd[0];}<br />
if ($time == 1) {$result .= &raquo; &laquo;.$hms[0]; $result .= &laquo;:&raquo;.$hms[1]; if ($second == 1) $result .= &laquo;:&raquo;.$hms[2];}<br />
return $result;<br />
}<br />
echo $myrow['burn_date'] = data_convert($myrow['burn_date'])</p>
<p>в результате выведет в таком формате: 12 Декабря 1970</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: admin</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-116</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 07 Mar 2008 08:02:31 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-116</guid>
		<description>Супер! Спасибо! :)</description>
		<content:encoded><![CDATA[<p>Супер! Спасибо! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: CaHeK</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-115</link>
		<dc:creator>CaHeK</dc:creator>
		<pubDate>Fri, 07 Mar 2008 07:31:04 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-115</guid>
		<description>Чуток подправил для удобства:
function data_convert($data, $year=1, $time=0, $second=0)
{
	$res = &quot;&quot;;
	$part = explode(&quot; &quot; , $data);
	$ymd = explode (&quot;-&quot;, $part[0]);
	if (isset($part[1])) $hms = explode (&quot;:&quot;, $part[1]);
	if ($year == 1) {$res .= $ymd[2]; $res .= &quot;.&quot;.$ymd[1]; $res .= &quot;.&quot;.$ymd[0];}
	if ($time == 1) {$res .= &quot; &quot;.$hms[0]; $res .= &quot;:&quot;.$hms[1]; if ($second == 1) $res .= &quot;:&quot;.$hms[2];}
	return $res;
}

Использование:
$str[’dt’] = data_convert ($str[’dt’]); //ДД-ММ-ГГГГ
$str[’dt’] = data_convert ($str[’dt’],0,1,1); //ЧЧ:ММ</description>
		<content:encoded><![CDATA[<p>Чуток подправил для удобства:<br />
function data_convert($data, $year=1, $time=0, $second=0)<br />
{<br />
	$res = &laquo;&raquo;;<br />
	$part = explode(&raquo; &raquo; , $data);<br />
	$ymd = explode (&laquo;-&raquo;, $part[0]);<br />
	if (isset($part[1])) $hms = explode (&laquo;:&raquo;, $part[1]);<br />
	if ($year == 1) {$res .= $ymd[2]; $res .= &laquo;.&raquo;.$ymd[1]; $res .= &laquo;.&raquo;.$ymd[0];}<br />
	if ($time == 1) {$res .= &raquo; &laquo;.$hms[0]; $res .= &laquo;:&raquo;.$hms[1]; if ($second == 1) $res .= &laquo;:&raquo;.$hms[2];}<br />
	return $res;<br />
}</p>
<p>Использование:<br />
$str[’dt’] = data_convert ($str[’dt’]); //ДД-ММ-ГГГГ<br />
$str[’dt’] = data_convert ($str[’dt’],0,1,1); //ЧЧ:ММ</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: admin</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-114</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 17 Feb 2008 21:06:19 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-114</guid>
		<description>Незачто ;) Удачи в программинге ;)</description>
		<content:encoded><![CDATA[<p>Незачто ;) Удачи в программинге ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Автор: Kirill</title>
		<link>http://dimoning.ru/mysql-date-to-normal.html/comment-page-1#comment-113</link>
		<dc:creator>Kirill</dc:creator>
		<pubDate>Sun, 17 Feb 2008 14:52:41 +0000</pubDate>
		<guid isPermaLink="false">http://dimoning.ru/archives/31#comment-113</guid>
		<description>Спасибо огоромное!
Очень удачная и простая и удачная функция...
Очень выручил и сэкономил кучу времени.....
Спасибо!!!</description>
		<content:encoded><![CDATA[<p>Спасибо огоромное!<br />
Очень удачная и простая и удачная функция&#8230;<br />
Очень выручил и сэкономил кучу времени&#8230;..<br />
Спасибо!!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

