<?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>运达&#039;s  blog &#187; date_format</title>
	<atom:link href="https://www.yunda51.com/?feed=rss2&#038;tag=date_format" rel="self" type="application/rss+xml" />
	<link>https://www.yunda51.com</link>
	<description>运达的博客</description>
	<lastBuildDate>Wed, 12 Nov 2025 07:58:26 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.19</generator>
	<item>
		<title>mysql时间戳转日期以及格式化日期时间</title>
		<link>https://www.yunda51.com/?p=1557</link>
		<comments>https://www.yunda51.com/?p=1557#comments</comments>
		<pubDate>Mon, 01 Jun 2015 01:31:51 +0000</pubDate>
		<dc:creator><![CDATA[运达]]></dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[php技术]]></category>
		<category><![CDATA[date_format]]></category>
		<category><![CDATA[from_unixtime]]></category>

		<guid isPermaLink="false">http://www.yunda51.com/?p=1557</guid>
		<description><![CDATA[mysql 将时间戳直接转换成日期时间： FROM_UNIXTIME( ):转为时间戳类型时间 UNIX_TI<a href="https://www.yunda51.com/?p=1557" class="read-more">Continue Reading</a>]]></description>
				<content:encoded><![CDATA[<p>mysql 将时间戳直接转换成日期时间：<br />
FROM_UNIXTIME( ):转为时间戳类型时间<br />
UNIX_TIMESTAMP( ) :返回长整形类型时间<br />
from_unixtime()是MySQL里的时间函数<br />
<strong>select  count(id) AS number,from_unixtime(reg_date, '%y-%m-%d') AS time from `gcar_coupon_user`  reg_date GROUP BY time ORDER BY time desc</strong>以上例子是sql语句的例子，直接能将mysql的时间戳类型转换成日期格式</p>
<p>mysql 将日期时间格式化时分秒：<br />
date_format(date,format)<br />
<strong>select  count(nid) AS number,date_format(pub_date, '%y-%m-%d') AS time from `hq_news`  pub_date GROUP BY time ORDER BY time desc</strong><br />
以上例子是，直接能将mysql的日期时间的时分秒给格式化了！</p>
<p>获取当前时间到23:59:59秒时间戳： eco  strtotime($btime=date('Y-m-d'.'23:59:59',time()));<br />
转载请注明转自:<a href="http://www.yunda51.com">运达's blog</a>  原文地址：<a href="http://www.yunda51.com/1557.html">http://www.yunda51.com/1557.html</a></p>
]]></content:encoded>
			<wfw:commentRss>https://www.yunda51.com/?feed=rss2&#038;p=1557</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
