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

midwestdev's avatar

Trying to parse a date from an api, getting weird results from carbon.

This is what the api returns for the datetime (which I assume is microtime) 1559308911000 and when I use

{{ \Carbon\Carbon::createFromTimestamp($item['createdDateTime']) }}

it returns this as the result

51382-07-13 20:10:00

Any idea what is going on. I should be getting day month year

0 likes
4 replies
midwestdev's avatar

I tried that and got the same result

this is what I suppose to be getting

May 31, 2019 - 8:21 AM

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Try dividing it by a 1000 :)

1 like
midwestdev's avatar

You're brilliant, thank you. That was driving me wacky.

Please or to participate in this conversation.