When working with JavaScript, I encountered a challenge in comparing two dates that are formatted differently. Specifically:
2015-09-30T00:00:00 and 9/30/2015 12:00:00 AM
The former is in UTC format while the latter is not. Despite referring to the same date and time logically, my attempts to compare them without inconsistencies have failed. Every time I create a new Date object for each date, the results differ due to the UTC offset relative to my local time zone.
What could be causing this discrepancy?