'; if((strtotime($_SESSION['time'])+60)$v) { $o.= "$k=".$v."&"; } $post_data=substr($o,0,-1); $this_header = array("content-type: application/x-www-fo...
分类:
移动开发 时间:
2015-05-07 16:18:20
阅读次数:
197
date_default_timezone_get():获得当前php的时区date_default_timezone_set():设置当前php的时区date("Y-m-d H-i-s")time(): 返回当前时间戳(1970-1-1——至今)单位秒strtotime(): 将以英文书写字符串(...
分类:
Web程序 时间:
2015-05-07 14:19:13
阅读次数:
139
functionplural($num){
if($num!=1)
return"s";
}
functiongetRelativeTime($date){
$diff=time()-strtotime($date);
if($diff<60)
return$diff."秒".plural($diff)."前";
$diff=round($diff/60);
if($diff<60)
return$diff."分钟".plural($diff)."前";
$diff=round($dif..
分类:
Web程序 时间:
2015-04-29 15:16:28
阅读次数:
182
$date1 = getdate(strtotime('2013-12-31'));$date11 = getdate(strtotime('2014-01-01'));$date2 = getdate(strtotime('2012-12-31'));print_r($date1);echo "\...
分类:
Web程序 时间:
2015-04-23 19:33:09
阅读次数:
778
echo time().''; $a = date("Y-m-d"); echo strtotime($a);此函数主要测试当我制定年月日不指定时分秒的时候它的输出是指向0时0分0秒,不能直接默认成为24时60分60秒
分类:
其他好文 时间:
2015-04-22 13:39:57
阅读次数:
143
有时候新闻或者消息提示有几条,可以用absolute定位来实现效果。原理是什么呢?1.获取数字或者状态。function getnewscount(){ $time = date("Y-m-d",strtotime("-3 day")); $where["News.che...
分类:
其他好文 时间:
2015-04-20 12:37:05
阅读次数:
165
1 function plural($num) { 2 if ($num != 1) 3 return "s"; 4 } 5 function getRelativeTime($date) { 6 $diff = time() - strtotime($date); 7 if ($dif...
分类:
Web程序 时间:
2015-04-14 14:30:37
阅读次数:
176
这些函数很常用,但是不用的话,像我这样的初学者放下就记不清了,这时最好的办法就是去查文档,写一下印象会更深一些1.时间戳函数strtotime():一个就是string to time(我自己这样理解),时间的一个字符串文档中格式:2.date()函数:格式化时间文档中格式:具体格式参考手册,下图举...
分类:
Web程序 时间:
2015-04-11 17:32:51
阅读次数:
162
本文章来给各位同学介绍一下利用php用strtotime或mktime指定日期数据(本周,上周,本月,上月,本季度)实例,希望对各位同学会有所帮助呀。strtotime定义和用法strtotime() 函数将任何英文文本的日期时间描述解析为 Unix 时间戳。语法:strtotime(time,no...
分类:
Web程序 时间:
2015-04-07 11:34:10
阅读次数:
200
php调整服务器时间代码strftime函数实现这一功能来自CODEGO.NET代码:$today=date(‘Y-m-d-G‘);$today=strftime("%Y-%m-%d-%H",strtotime("$today-5hour"));
分类:
Web程序 时间:
2015-04-03 19:42:55
阅读次数:
161