Level 48
Just pass it to the constructor.
moment("{{ $date->format('c') }}");
If your date is a string you might need to provide the format as a second parameter depending on the format.
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Is there a way to mutate a date string into a moment object ? I need it for daterangepicker
Please or to participate in this conversation.