PHP date calculation

前端 未结 11 1568
不知归路
不知归路 2021-01-01 08:19

What is the best (date format independent way) in PHP to calculate difference in days between two dates in specified format.

I tried the following function:

11条回答
  •  生来不讨喜
    2021-01-01 09:08

    gregoriantojd() gives the same results as using strtotime(), see this blogpost for how to do it:

    http://www.phpro.org/examples/Calculate-Age-With-PHP.html

提交回复
热议问题