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

usamamashkoor's avatar

Laravel php and mysql datetime difference

Hi friend i am creating a chat system in php laravel mysql i want to show messages on the chat box related to datetime and i am using a timestamp and created_at in mysql for storing datetime but the problem i am facing here is that mysql timestamp and php created_at datetime is storing different datetime in database and i am using now() mysql function in mysql queries and also my local time is different to than the stored time. also i want to show when i send a message now from Pakistan and for you the message date time should display as 12/25/2015 11"04 PM and for me in USA the date time should display as 12/25/2015 12:05PM. Kindly please help me on this. Thanks an advance.

0 likes
0 replies

Please or to participate in this conversation.