mardi 6 octobre 2015

Laravel Query Builder - Get Current Time From MySQL

I want to get current time of MySQL in Laravel 5.1

What I have done is

    $time = DB::select( DB::raw('SELECT NOW() AS end_time'));
    return $time[0]['end_time'];

I want to get a output like it-

2015-10-06 17:02:32

But, it is not working.

Can anyone please help?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire