antonyfal Posted February 25, 2014 Share Posted February 25, 2014 (edited) 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 February 25, 2014 by antonyfal Quote Link to comment Share on other sites More sharing options...
jairathnem Posted February 25, 2014 Share Posted February 25, 2014 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>") Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted February 25, 2014 Share Posted February 25, 2014 You could look into the following options: http://www.php.net/manual/en/function.gmmktime.php http://www.php.net/manual/en/datetime.settimezone.php Quote Link to comment Share on other sites More sharing options...
antonyfal Posted February 25, 2014 Author Share Posted February 25, 2014 Thanks jairathnem and cyberRobot for your reply's. I will look into what you gave me and get back as soon as i have something. regards Antony Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.