-2

I would like to get the total number of seconds based from the given time, for example the following given data below:

$timein=04-01-2017 7:56:37 am;
$timeout=04-01-2017 5:15:17 pm;
$totalseconds= ?
Sahil Gulati
  • 15,028
  • 4
  • 24
  • 42
Carl Angelo Nievarez
  • 573
  • 1
  • 11
  • 33

1 Answers1

3

PHP code demo

<?php
$time1=strtotime("04-01-2017 7:56:37 am");
$time2=strtotime("04-01-2017 5:15:17 pm");
echo $time2-$time1;
Sahil Gulati
  • 15,028
  • 4
  • 24
  • 42