开发者

database field with type timestamp is not updating

Duplicate of database timestamp value is not updating

I have a variable which contains the date and time in 0000-00-00 00:00:00 format but when i put this variable in database field with type timestamp .. i开发者_Go百科t is still 0000-00-00 00:00:00


Make sure that you are using the right format of the datetime. Mysql default datetime format is YYYY-MM-DD H:i:s. But, it seems that you are trying to insert the datetime value with the format of (YYYY:MM-DD H:i:s). It does not allow to insert the datetime value, so the inserted value becomes 0000-00-00 00:00:00.

Try by changing your calendar format to (YYYY-MM-DD H:i:s). I assume that you are using datatime datatype for the Valid_till column. Click the below to know more about mysql data structure.

Mysql Date format

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜