confusion with adding 2 time values

前端 未结 3 1719
不思量自难忘°
不思量自难忘° 2021-01-23 06:19

Basically this whole time stuff is frustrating me, I am new to programming so I do apologise if I am asking a stupid question.

I have a MySQL time() stored in my databas

3条回答
  •  余生分开走
    2021-01-23 06:33

    Strtotime is propagating a date inside there, something like "6PM today", instead of 6 hours like you intend. The easiest way to do this is to run

    time() + (6 * 3600);
    

    Where 6 is hours, and 3600 is the number of seconds in each hour.

提交回复
热议问题