PHP date_modify() 函数

PHP 教程 · 2019-01-23 21:13:39

实例

修改时间戳。增加 15 天:

<?php
$date=date_create("2013-05-01");
date_modify($date,"+15 days");
echo date_format($date,"Y-m-d");
?>

定义和用法

date_modify() 函数修改时间戳。

语法

date_modify(object,modify);

参数 描述
object 必需。规定一个由 date_create() 返回的 DateTime 对象。
modify 必需。规定一个日期/时间字符串。

技术细节

返回值: 如果成功则返回一个 DateTime 对象。如果失败则返回 FALSE。
PHP 版本: 5.2+
更新日志: PHP 5.3.0:返回值从 NULL 改为 DateTime。

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Python Data Structures and Algorithms

Python Data Structures and Algorithms

Benjamin Baka / Packt Publishing / 2017-5-30 / USD 44.99

Key Features A step by step guide, which will provide you with a thorough discussion on the analysis and design of fundamental Python data structures.Get a better understanding of advanced Python c......一起来看看 《Python Data Structures and Algorithms》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具