0

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

Thanks!

PeeHaa
  • 69,318
  • 57
  • 185
  • 258
EOB
  • 2,887
  • 17
  • 42
  • 68

2 Answers2

6

Use the Julian Day

$days = unixtojd($t1) - unixtojd($t2);
Rob Agar
  • 12,054
  • 4
  • 44
  • 59
3
$days = (int) ( abs($timestampA - $timestampB) / ( 60 * 60 * 24 ) );
hsz
  • 143,040
  • 58
  • 252
  • 308
  • This returns me 415000 days for example ... it needs more brackets, but its working. It has to be (60 * 60 *24). – EOB Jan 24 '12 at 13:32