Help needed - JS app. From local machine time to UTC

Gary Carlyle

Regular Member
Joined
Aug 27, 2010
Messages
307
Reaction score
66
Hi,

I have a JS app. Its a TV guide but instead of displaying results in the client based on their Windows time I want to display results for the them based on UTC time.

I can code in PHP but I'm clueless with JS.

Help please if you can.
 
Hello Gary. I would love to help you out with the JS code. PM me if you would like me help.
 
Take a look at MomentJS
Code:
http://momentjs.com/timezone/
 
Code:
function timezone() {
  var myTime= new Date()
    var offset = myTime.getTimezoneOffset();
offset=  offset * 60000
offset=offset+myTime.getTime()
UTCTime= new Date(offset)
return UTCTime.getHours()+":"+UTCTime.getMinutes()+":"+UTCTime.getSeconds()
 
 
 
}
 
Last edited:
Back
Top