Strange behavior of PHP time math: Why is strtotime() returning negative numbers?

前端 未结 5 925
星月不相逢
星月不相逢 2020-12-12 00:51

I\'m trying to do some very basic time math - basically, given inputs of time and distance, calculate the speed. I chose to use strtotime() to convert the time inputs into s

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 01:34

    If you want to do something like that, I think you want to just do some math on the time strings themselves and convert them to a number of seconds, like this:

    
    

提交回复
热议问题