문제

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.

도움이 되었습니까?

해결책

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top