0

I hope nobody asked this question here before,

  • I am creating a timestamp on the client side, mobile app (different countries)
  • I am getting a timestamp from the server (always the same country)

My goal is that both unix timestamps should have the same timezone (client & server). Is there a way in JS or jquery to transform both to one zone?

best

M

mboeckle
  • 938
  • 13
  • 29
  • 1
    You should work with UTC0 (GMT). There is a function that helps you to calculate the offset of this date http://stackoverflow.com/questions/8945029/converting-date-to-gmt-0 – Martín Alcubierre Sep 01 '14 at 19:33
  • 1
    UTC fo sho, also I have had a lot of luck using moment.js and livestamp.js. I believe if you store UTC time moment.js and javascript use client's timezone for calculations – Theodore Enderby Sep 01 '14 at 22:11
  • exactly what I was searching for: http://mattbradley.github.io/livestampjs/ – mboeckle Sep 01 '14 at 23:06

0 Answers0