thinkphp time problem
黄舟
黄舟 2017-05-27 17:42:48
0
2
692

The database has a field called the askTime field. Every time data is inserted, the current time will be stored. The format is year, month, day, hour, minute and second. But the problem is I don’t know how to take it out as it is?
Try one: var_dump($date['askTime']) output is null
Try two: echo date("Y-m-d H:i:s",$date['askTime']) output 1970-01- 01 08:00:00, but the time zone has been set in the config file
How does tp3.2 output the formatted date in the database as it is? ?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
伊谢尔伦

What you save is the formatted time, then you can retrieve it as a string. Unless you converted it when saving, it is best to take a screenshot to see the data in the database field

滿天的星座

1. Screenshot database askTime content

2. If askTime is a string and not a timestamp, don’t use date

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template