最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php日期所在月的第一天日期和最后一天
时间:2009-11-23 编辑:简简单单 来源:一聚教程网
php日期所在月的第一天日期和最后一天
/**
* 日期所在月的第一天日期
* @return int
*/
public function getFirstDayOfMonth ($format = 'timestamp') {
$day = $this->getPart('yy') . '-' . $this->getPart('mm') .
'-' . '01';
if ($format=='timestamp') {
$day = (int)$this->toTimeStamp($day);
}
return $day;
}
/**
* 日期所在月的最后一天日期
* @return int
*/
public function getLastDayOfMonth ($format = 'timestamp') {
$day = $this->getPart('yy') . '-' . $this->getPart('mm') .
'-' . $this->daysOfMonth();
if ($format=='timestamp') {
$day = (int)$this->toTimeStamp($day);
}
return $day;
}
-
上一个: php 格式化输出日期函数
-
下一个: php ip获取与判断IP分段类
相关文章
- PHP实现针对日期,月数,天数,周数,小时,分,秒等的加减运算 04-25
- php 计算两个日期这间的间隔天数 08-23
- php 日期加减法运算实现代码 12-09
- 收集了几款常用php日期操作 01-22
- php日期格式详细说明 07-23
- php日期所在月的天数 11-21