Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1455700
  • 博文数量: 408
  • 博客积分: 10036
  • 博客等级: 上将
  • 技术积分: 4440
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-06 13:57
文章分类

全部博文(408)

文章存档

2011年(1)

2010年(2)

2009年(1)

2008年(3)

2007年(7)

2006年(394)

我的朋友

分类:

2006-09-08 16:10:12

strtotime将文本日期时间解析为Unix时间戳
http://blog.chinaunix.net/u/13329/showart.php?id=165832
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  ";
.本月月末
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
阅读(2373) | 评论(0) | 转发(0) |
0

上一篇:逐行读取文件内容

下一篇:Nagios的使用

给主人留下些什么吧!~~