tags:

views:

37

answers:

2

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

+1  A: 

Unfortunately, PHP has no way of telling what the user's local time is.

I suggest using Javascript for that.

R. Bemrose
A: 

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