您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP---日期时间

2025/5/28 22:10:08发布8次查看
取得当前的unix时间戳
从1970.1.1(00:00:00)—当前时间的秒数和
取得当前的日期
date();
date(时间戳的格式, 规定时间戳【默认是当前的日期和时间,可选】)
//date函数,第二个参数取默认值的情况echo date(y-m-d);//2014-03-30//date函数,第二个参数有值的情况echo date(y-m-d,'1396193923');//2014-03-30,1396193923表示2014-03-30的unix时间戳
获取日期的时间戳
strtotime();
strtotime(2016-02-05);strtotime(2016-2-5); //测试也可行
将格式化的日期字符串转换成unix时间戳
strtotime(now);strtotime(+1 seconds);strtotime(+1 day);strtotime(+1 week);strtotime(+1 week 3 days 7 hours 5 seconds);
格式化格林威治(gmt)标准时间
// gmdate() //y-m-d h:i:sdate_default_timezone_set(asia/shanghai);echo date('y-m-d h:i:s', time());echo gmdate('y-m-d h:i:s', time());
').addclass('pre-numbering').hide(); $(this).addclass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadein(1700); }); }); 以上就介绍了php---日期时间,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product