laravel - PHP - Check difference between 2 different time format -


i'm saving updated_at time in database being handled laravel.

i want check difference between field updated_at value , time in minutes .

this how current time :

$now = time(); 

this echo results :

updated @ : 2017-09-10 13:14:29 time : 1505051247 

any idea how check time between these 2 values minutes.

thanks

you using laravel use power of carbon

$updated_at = \carbon\carbon::parse('2017-09-10 13:14:29'); $timenow = \carbon\carbon::createfromtimestamp(1505051247); // should use \carbon\carbon::now()  $diffinminutes = $updated_at->diffinminutes($timenow); dd($diffinminutes); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -