0

I need to convert UTC/Local time to GMT+(?) format on requested timezone... eg..

UTC to GMT 0
UTC to GMT+1
UTC to GMT-1
UTC to GMT+5
UTC to GMT-5
GMT+5 to GMT+4
GMT+5 to GMT-3
Yousha Rizvi
  • 35
  • 1
  • 10
  • Natively, _JavaScript_ only supports producing _UTC_ and _local_ times from a _Date_. You can start from any timezone if you use _ISO 8601_ formatting, though. – Paul S. Oct 04 '14 at 11:00

2 Answers2

2
var inputDateTime = "Thu Sep 24 2015 15:00:00 GMT+0530 (IST)";
var date = new Date(inputDateTime );
var GMTtime= ((date.getUTCMonth() + 1 ) + '/' + date.getUTCDate() + '/' + date.getUTCFullYear()+ ' ' + date.getUTCHours()+ ':' + date.getUTCMinutes()+ ':' + date.getUTCSeconds()+" GMT");
shruthics
  • 21
  • 5
0

UTC is GMT for most practicable purposes. We (the English) invented it. Just add/subtract the hours.

Please visit Greenwich. Just outside london.

Ed Heal
  • 59,252
  • 17
  • 87
  • 127