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

jonas1's avatar

How to make carbon count from seconds

I made my application to show the time when users where lastly seen online. The time started from seconds. It was working well. after I did some little work on my server, the timer started counting only hours. For example if a user is currently online, the timer will say the user was seen 1 hour ago which is not true.

My question is is there a specific php/ubuntu/nginx configurations that I most respect before carbon can work properly? Please help

0 likes
4 replies
Snapey's avatar

Carbon just uses the php Date class. It works in milliseconds.

Any error is likely to be just with your presentation.

Give it 2 minutes. Does it say the other user was online 1hr 2mins ago indicating perhaps there is a timezone issue?

Please or to participate in this conversation.