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

abdulrafey38's avatar

Date and time getting but not from by PC

Hey, guys i need some help regarding my project, i need to get time and date in php which returns result not from my pc or system but from an online authentic source, because i created a system in which correct time and date is necessary for some security reasons, but if someone changes time in his/her system he/she can get that information after expiration time too.

0 likes
3 replies
youri's avatar
youri
Best Answer
Level 3

PHP runs on the server, not the user's device. So it shouldn't really matter what the system time of the user's device is.

1 like
fylzero's avatar

@abdulrafey38 You may find this useful...

https://laravel-news.com/laravel-timezone

I would keep your server time in UTC.

This package will let you automatically save the timezone your users are in. I would give them the ability to change this.

Also, of you just need to display UTC to the local user timezone just use monent js. It does all the work for you.

1 like

Please or to participate in this conversation.