Welcome Guest, Not a member yet? Register   Sign In
Determine event length based on start and end timestamps
#1

[eluser]derekmichaeljohnson[/eluser]
Code:
$event = array(
    'start' => '2010-03-15 08:00:00',
    'end' => '2010-03-15 10:30:00'
);
How can I best determine the number of minutes between the start and end date?

Thanks in advance!
#2

[eluser]danmontgomery[/eluser]
Code:
$seconds = strtotime($event['end']) - strtotime($event['start']);
$minutes = $seconds / 60;

http://php.net/manual/en/function.strtotime.php
http://en.wikipedia.org/wiki/Unix_time
#3

[eluser]derekmichaeljohnson[/eluser]
Thanks, noctrum. Just what I needed.




Theme © iAndrew 2016 - Forum software by © MyBB