php中的unix时间戳问题

来源:互联网 发布:淘宝的认证照片怎么拍 编辑:程序博客网 时间:2024/05/17 09:27
<script type="text/javascript"><!--google_ad_client = "pub-4490194096475053";/* 内容页,300x250,第一屏 */google_ad_slot = "3685991503";google_ad_width = 300;google_ad_height = 250;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
系统函数time()返回值是一个UNIX 时间戳。


在Unix中,时间的表示方式为计算从1970年1月1日零时起所过去的秒数,这称为UNIX 时间戳(Unix Epoch)。


而用如下代码:
$string = time();
$day = strftime("%Y-%m-%d", localtime($string)) ;
print "$day<br>";


则可以输出期当前时间,是一个UNIX 时间戳转换系统时间函数。
原创粉丝点击