Compare 2 timestamps in PHP and get the days between?

后端 未结 2 998
春和景丽
春和景丽 2021-01-28 03:44

I have 2 timestamps (like 3434368673) an want to get the days between them. How can I do that?

Thanks!

相关标签:
2条回答
  • 2021-01-28 04:02
    $days = (int) ( abs($timestampA - $timestampB) / ( 60 * 60 * 24 ) );
    
    0 讨论(0)
  • 2021-01-28 04:22

    Use the Julian Day

    $days = unixtojd($t1) - unixtojd($t2);
    
    0 讨论(0)
提交回复
热议问题