Jump to content

PHP date and check time since date.

Joveice
Go to solution Solved by Joveice,

<?php$to_time = strtotime("2008-12-13 10:42:00");
$from_time = strtotime("2008-12-13 10:21:00");
echo round(abs($to_time - $from_time) / 60,2). " minute";

Okey I'm trying to create two scripts one which says how many minutes in numbers since date " (21/11/16/15:35" and the other one should check how long until a date in minutes. how would I do it?

so the script I have will create etc  20/11/16/15:35 and then when this other script check (21/11/16/15:35) it returns "1440".

the date is stored as 20/11/16/15:35 in $storeddate

how would I do this?

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

<?php$to_time = strtotime("2008-12-13 10:42:00");
$from_time = strtotime("2008-12-13 10:21:00");
echo round(abs($to_time - $from_time) / 60,2). " minute";

Back-end developer, electronics "hacker"

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×