PHP中的date_create()函数
date_create()函数返回新的DateTime对象。
语法
date_create(time,timezone);
参数
时间-指定的日期/时间字符串。
时区-指定时间的时区。
返回
date_create()函数成功返回一个新的DateTime对象,失败则返回FALSE。
示例
以下是一个例子-
<?php
$date = date_create("2018-07-25 21:15:00",timezone_open("Europe/Oslo"));
echo date_format($date,"Y/m/d H:iP");
?>输出结果
以下是输出-
2018/07/25 21:15+02:00
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短