Jump to content

Show his time in my time..


antonyfal

Recommended Posts

Hi..

Im working on a script to invite some one to a live chat/video session.. The people involved are global, from all parts of the world..

 

How it works:

profile "A" stipulates his/her available times, as IE: 13:00pm , 12:00pm, 16:00pm, 19:00pm. (lets say this is a GMT +4 timezone);

 

profile "B" wants to chat to profile "A" and sees the available times to book the appointment to chat.. If profile "B" is in the GMT -4 timezone.. How can i display Profile "A"'s times in profile "B"'s timezone..

 

if it's 13:00pm in +4 GMT its (totally out of my thumb) 04:00am in profile "B"'s time..

 

also is php the best way to achieve this? or jquery javascript?

i have no code..

Link to comment
https://forums.phpfreaks.com/topic/286508-show-his-time-in-my-time/
Share on other sites

PHP will only get the server time. To get the client time use javascript.

Here is a sample code from google.

var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()

if (minutes < 10)
minutes = "0" + minutes

document.write("<b>" + hours + ":" + minutes + " " + "</b>")

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.