I want to show on my website current india time using javascript and i need to access the hour,min,sec,day because i want to make a ticking clock with that
I now if we have a new Date() object we can do this via
currentTime = new Date();
var h = currentTime.getHours();
var m = currentTime.getMinutes();
var s = currentTime.getSeconds();
But this method shows the local time of the user i want to always show the Indian time doesn't matter where the user is. How I can input the offset in the new date object so that it gives me Indian time
I tried this
utc = new Date().getTime();
var current_indian_Time = new Date(utc + (3600000*offset));
But this is not working
There is too many answers on the StackOverflow i am totally confused. Thanks