I started trying to use ChatGPT instead of google for a lot of my queries. The tricky part is unlearning how to search.<p>For instance, I had a timestamp 2022-11-27 00:00:00.000 and wanted to display it in local string. The problem was (depending on your time zone) if you do new Date("2022-11-27 00:00:00.000").toLocaleString(), you get 11/26/2022<p>So I would have googled something like "pass timezone to toLocaleString", which would give me this answer [0]. But its still a lot.<p>Instead in ChatGPT I would ask:<p>> assume i'm in EST timezone, en-US<p>> const d = "2022-11-27T00:00:00.000Z"<p>> const dd = new Date(d)<p>> How can I print out local string as Sun Nov 27 2022?<p>To which it replied:<p>> const d = "2022-11-27T00:00:00.000Z";<p>> const dd = new Date(d);<p>> console.log(dd.toLocaleDateString("en-US", { timeZone: "America/New_York" }));<p>But the answer was actually wrong, which is fine! Easy to test<p>> This actually prints out 11/26/2022, 7:00:00 PM. Try again<p>To which it replied:<p>> The output you are getting is correct, because the date you provided is in the UTC time zone, and you are formatting it using the Eastern Time (ET) time zone...<p>> const d = "2022-11-27T00:00:00.000Z";<p>> const dd = new Date(d);<p>> console.log(dd.toLocaleString("en-US", { timeZone: "UTC" }));<p>> // Output: "11/27/2022, 7:00:00 PM"<p>It was pretty incredible and much better than stackoverflow as now I don't have to worry about generalizing my answer or implementing the answer to my particular use case. ChatGPT tends to be verbose but the code is clearly noted and you can often ignore the words for simple tasks.<p><a href="https://stackoverflow.com/questions/17478086/chrome-timezone-option-to-date-tolocalestring" rel="nofollow">https://stackoverflow.com/questions/17478086/chrome-timezone...</a>