PHP date_time_set() 函数

PHP 教程 · 2019-01-23 23:11:41

实例

设置时间:

<?php
$date=date_create("2013-05-01");
date_time_set($date,13,24);
echo date_format($date,"Y-m-d H:i:s");
?>

定义和用法

date_time_set() 函数用于设置时间。

语法

date_time_set(object,hour,minute,second);

参数 描述
object 必需。规定一个由 date_create() 返回的 DateTime 对象。
hour 必需。规定时间中的小时。
minute 必需。规定时间中的分。
second 可选。规定时间中的秒。默认为 0。

技术细节

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

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

查看所有标签

Distributed Algorithms

Distributed Algorithms

Nancy A. Lynch / Morgan Kaufmann / 1996-3-15 / USD 155.00

In "Distributed Algorithms", Nancy Lynch provides a blueprint for designing, implementing, and analyzing distributed algorithms. She directs her book at a wide audience, including students, programmer......一起来看看 《Distributed Algorithms》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

html转js在线工具
html转js在线工具

html转js在线工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具