Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

henryoladj's avatar

How can i add Current Date and Time in Laravel

I want to add current date and time to my laravel site but i am finding it difficult to add it.

0 likes
5 replies
Nakov's avatar

You can use the now() helper function and format it the way you want:

now()->format('d-m-Y H:i');

// => "05-09-2019 12:13"

Snapey's avatar

and if you want it to show in a view, just wrap it in blade tags

{{ now()->format('d-m-Y H:i'); }}

Just bear in mind that this is the SERVER time, and might be a different timezone to your user.

so 'Current' date time is relative to where you are in the world.

If you want to show the user's own date/time (and they cannot be bothered to look at their toolbar) then use javascript and get the time from the user's own browser.

henryoladj's avatar

What if i want to make it in this format : Thursday, 05 September 2019 at 01:16 PM?

Please or to participate in this conversation.