how to get the local time in simple meridian format in php
can u please help me out with the codes to get the present time n the meridian format..开发者_运维问答like its 1920 hours or 07.20 pm... how to make it independent of the location .. meaning... the users everywhere round the world shud get their local times....
Unfortunately, PHP has no way of telling what the user's local time is.
I suggest using Javascript for that.
If you ask time()
, it will always give you the time on the server.
If you want the users localized time, you'll need to:
- depend on the clienttime with javascript, but this might not be the correct time
- calculate the correct time by the user's time zone, but I don't have a clue how this can be done.
精彩评论