-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
  • 14,792
  • 4
  • 23
  • 42
Carl Angelo Nievarez
  • 493
  • 1
  • 12
  • 26

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
  • 14,792
  • 4
  • 23
  • 42