Can I retrieve user local time with php?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wilkas
Forum Newbie
Posts: 1
Joined: Thu Apr 10, 2003 6:41 am

Can I retrieve user local time with php?

Post by wilkas »

If yes then how?
Rob the R
Forum Contributor
Posts: 128
Joined: Wed Nov 06, 2002 2:25 pm
Location: Houston

Post by Rob the R »

Since PHP is executed on the server, it can't directly return the local time zone of the user. You'd have to use some Javascript in combination with PHP to do what you want. I found a reference to such a technique at this website:
http://martin.f2o.org/php/localtime
but I have not tried it myself, so I can't make any claims to its usefulness or correctness.
Post Reply