开发者

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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜