-1

I want to find 15 minutes different between link has sent time and link activated time.For that, I am as below,

<?php

$sentTime=strtotime(date("2018-05-29 06:11:42"));
$curTime=strtotime(date("Y-m-d h:i:s"));
$difference=$curTime-$sentTime;

echo $sentTime;
echo '<br>';
echo $curTime;
echo '<br>';
echo $difference;
?>

When I do like this it gives some number, What is those number indicate? If it is time, whether is it in minute or seconds or milli seconds?

Can anybody assist me?

Vidya
  • 382
  • 1
  • 6
  • 17

2 Answers2

1

The function strtotime() returns a timestamp, which is the number of seconds elapsed since Jan 01 1970 (UTC).

$sentTime, $curTime and $difference are seconds.

Cid
  • 14,968
  • 4
  • 30
  • 45
-2

Please use like this way, its the proper way to declare date

  $senttime= date("Y-m-d H:i:s",strtotime("2018-05-29 06:11:42"));
Sanjun Dev
  • 518
  • 8
  • 20
  • 1
    Downvoted because it doesn't answers OP's question and giving code without explanation isn't welcome on SO and won't help anyone. – Cid May 29 '18 at 09:36