I do have an array of objects coming from API, each of the object containing a property called jpExpiryTime.
[{ ...
offer: '',
jpExpiryTime: 2019-09-26 15:00:00
},
{ ...
offer: '',
jpExpiryTime: 2019-09-26 15:00:00
}]
The above date and time value are assigned from the Japan region. I do have a portal which is accessed from India which shows me the list of the above offer data. I want to know if the above offer has expired or not by comparing with the current date and time. I tried the below:
new Date('2019-09-26 15:00:00') > new Date ()
But I find that new Date('2019-09-26 15:00:00')
converts the data to IST rather than Japan Standard Time (JST). Could someone shed some light on how to compare a date-time string from one timezone with another date object in another timezone.