<?php now();
Getting Current Date In Laravel
To get the current date you can call the "now()" helper function and then call the "toDateTimeString()" method with the format of the date.
{{ now()->format('Y-m-d') }}
Getting Current Time in Laravel
To get the current time you can provide a different format to the "toDateTimeString()" method and it's as follows.
{{ now()->format('H:i:s') }}
Getting Current Day in Laravel
Lastly to get the "day" you can provide the format "l" inside "toDateTimeString()" method. (lowercase "L")
{{ now()->format('l') }}
Leave a reply