Skip to content
Advertisement

PHP Carbon format to New Date() on Javascript

I want my website changed to full server-side, or with little client-side. What format was used by Carbon to Javascript Date object? Something like this?

Wed Feb 23 2022 12:46:13 GMT+0700 (Western Indonesia Time)

Advertisement

Answer

You can read here for Carbon documentation, and you can format Carbon instance whatever you like

Carbon::now()->format('Y-m-d H:i:s');
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement