博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

cnsLinux博客

操作系统|编程语言|服务器|网络|防火墙|安全|路由|数据库|备份|日志|IT|电子邮件|流媒体|健康|医院|求职|招聘|工作|人才|空间Linux|C|C++|Java|Python|PHP|SQL|类库|网页|office|英语
  cnscn2008.cublog.cn

关于作者
作者:cnscn 
QQ: 214363570
MSN:cnscn@163.com
主页:http://www.cnscn.org    

文章要有质量...
|| << >> ||
我的分类


strtotime将文本日期时间解析为Unix时间戳
<?php
echo strtotime("2006-01-09");
echo strtotime("2006-01-09 08:10");
echo strtotime("now");
echo
strtotime("10 September 2000");
echo
strtotime("+1 day");
echo
strtotime("+1 week");
echo
strtotime("+1 week 2 days 4 hours 2 seconds");
echo
strtotime("next Thursday");
echo
strtotime("last Monday");
?>

.今日日期号
$days=date('d',strtotime('now'));  //2006-09-06

.当前月月初
echo $currMBegin=date("Y-m",    strtotime('now'))."-01 &nbsp;";
.本月月末
echo $currMEnd  =date("Y-m-d",  strtotime("next month -$days day"));

.下月月初
echo $nextMBegin=date("Y-m",    strtotime('next month'))."-01";
.下月月底
echo $nextMEnd  =date("Y-m-d",  strtotime("+2 months -$days day"));

2006-09-01  2006-09-30
2006-10-01  2006-10-31


发表于: 2006-09-06,修改于: 2006-09-06 13:09,已浏览570次,有评论1条 推荐 投诉


网友评论
网友: ileap 时间:2008-06-12 12:21:41 IP地址:125.34.53.★
thank you

 发表评论