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

Edited by antonyfal
Link to comment
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>")
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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