I'm working with the timestamp 1536300084, at the moment I'm simply printing it in a blade template using
{{ $timestamp }}
Is there a way to format this such as in twig?
{{ post.published_at|date("m/d/Y") }}
Hmm thats a bummer. You could use something like moment.js, but thats also a Javascript library. Im not sure of there is a masking function in laravel.
Maybe you could write your own directive and call it something like:
Newbies solution also was what I was after but hats off to Snapey for answering with Carbon which you can get a lot more use out of. I was hoping it wouldn't be so ugly to print it out to a view.
I've come from Symfony/Twig to Laravel/Blade and just picking up on the differences.
@JamLizzy101 parse time will not work on 24 hours increments. It will show 5 hours ahead for some reason. As noted by @snapey use CreateFromTimestamp.
I know this is old but i do not want others to use this and have issues. i did not realize this until i sent it to the customer and it was for a shift exchange module. So everyone showed up 5 hours late for work. Lets say our customer was not every happy with us.