I've a timezone. say GMT+6.30. now I want to add/minus few hours to it? How to do that! I've tried every way that I can find on net. I got the timezone from earth tool.
Here is what I tried.
I tried to set the time with date
object and use .getTimezoneOffset();
but it didn't return based on time that I set. Rather showing local timezone.
Suppose I've set london date time in a date object and used date.getTimezoneOffset();
and I'm on timezone +5
, then it's showing +5
not 00
I have also thought manual adding, that's a big work. So what I need is to know that is there any function to add/minus some minutes and hours to timezone?? I can also get the +0630
formatted timezone, will it help to easily add few hours?
Or can you suggest me a easy way to get the timezone from a date time?