php strtotime给出默认日期 [英] php strtotime giving default date

查看:127
本文介绍了php strtotime给出默认日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将日期转换为其他格式,但显示默认日期。

I want to convert date into another format but its shows default date.

$date ='2050-12-12 00:00:00';

echo $product_expire_date = date('Ymd', strtotime($date));

它显示默认日期19700101。

It shows the default date 19700101.

推荐答案

timestamp 的有效范围通常来自 Fri,13 Dec 1901 20:45:54 UTC to Tue,19 Jan 2038 03:14:07 UTC 。 (这些是对应于32位有符号整数的最小值和最大值的日期。)

The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 UTC to Tue, 19 Jan 2038 03:14:07 UTC. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.)

http://php.net/strtotime#refsect1-function.strtotime-notes

这篇关于php strtotime给出默认日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆