-1

I have a date time string like this 2018-09-10T12:05:00 and I know the timezone associated with the date. Assume timezone available is Asia/Singapore. How can I get the UTC date with this info available?

There's no timezone associated with date string itself. First step would be to associated a timezone with date and then convert it into UTC. Suggested answers are close but do not help my case ?

UPDATE: Still no luck with this.

WLKB
  • 11
  • 1
  • 3

1 Answers1

1

Simply just use this method:

var isoDate = new Date('yourdatehere').toISOString();

  • my date is just datetime string `2018-09-10T12:05:00`. When I try this on console I see this `2018-09-10T20:05:00.000Z` which seems incorrect. Also my current timezone is Alaska. – WLKB Jul 18 '18 at 06:06