Hello Developer,Hello Dev,
In this short guide, we will show you how to get current date and time in laravel. This article goes in detailed on how to get current date in laravel. you'll learn how to get current time in laravel. I explained simply about how to get current timestamp in laravel. Alright, let’s dive into the steps.
You can use this example with laravel 6, laravel 7, laravel 8, laravel 9 and laravel 10.
In this example, i will show you how to get current date, time, timestamp and day in laravel application. we will use now()
Example 1: Laravel Get Current Timestamps
$timestamp = now();
Example 2: Laravel Get Current Date
$date = now()->format('Y-m-d');
Example 3: Laravel Get Current Time
$time = now()->format('H:i:s');
Example 4: Laravel Get Current Day
$time = now()->format('l');
I hope it can help you...
Do you like below Tutorials ?
- Multidimensional Array Search By Value in PHP
- Laravel Install Font Awesome Icons Example
- How to Use Moment JS in Laravel?
- Angular 9 Get Environment Variables Example
- Angular Delete a Component From Cli Example
- How to Upload File from Local to Server using SSH?
- Angular Use CKEditor Example Tutorial
- How to Use Multiple Select Dropdown in Laravel?