0

I am a novice in JavaScript.

My need is to change IST (Indian Standard Time) time to any other standard. For Example PST (Pakistan Standard Time). User enters IST time 10:30(HH:MM) in a text field. How can I convert this time to PST.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
java baba
  • 2,199
  • 13
  • 33
  • 45

1 Answers1

1

how change user input time like 10:30(HH:MM)

You can use a split on the input value:

var parts = inputElement.value.split(':'),
    hours = parseInt(parts[0], 10),
    mins  = parseInt(parts[1], 10);

(error checking should of course be applied as well).

Then use this answer as Justin K references:
Javascript countdown using absolute timezone?

Community
  • 1
  • 1