5 ms·
> The tricky part is unlearning how to search. Hum I'd argue that you've never learned how to search. I would have searched for "javascript date to string in
by iLoveOncall 4y ago
> The tricky part is unlearning how to search.
Hum I'd argue that you've never learned how to search.
I would have searched for "javascript date to string in specific timezone", and it would have given the following result, which is exactly what ChatGPT gives: https://stackoverflow.com/questions/10087819/convert-date-to-another-timezone-in-javascript https://stackoverflow.com/questions/10087819/convert-date-to...
Actually, if you already know that you can pass a timezone to toLocaleString(), I would just go on the documentation of the function: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
I'm starting to understand why there are so many people on HN claiming that "Google has started to give me bad results in recent years".
- isthiseasymode 4y ago> I'm starting to understand why there are so many people on HN claiming that "Google has started to give me bad results in recent years". I thought I was going crazy. Googles been working fine for me and I was wondering if I was just being delusional or in denial.
- david_allison 4y agoI was served maybe 60-80% spam from Google around 10 months ago (now resolved). The results you see can be significantly different from what others see. Sample from 10 months ago: https://i.imgur.com/Hla7cyT.jpg https://i.imgur.com/Hla7cyT.jpg
- alvarezbjm-hn 4y agoIn that resolution, the picture is almost a blurr.
- david_allison 4y agoSeems fine to me curl -O https://i.imgur.com/Hla7cyT.jpeg && sips -g pixelHeight -g pixelWidth -g dpiWidth -g dpiHeight Hla7cyT.jpeg pixelHeight: 2009 pixelWidth: 1879 dpiWidth: 72.000 dpiHeight: 72.000
- Oxidation 4y agoIf you're on mobile, Imgur doesn't allow you to view a high resolution version. You have to copy the image URL and then adjust the maxwidth query parameter: https://i.imgur.com/Hla7cyT_d.webp?maxwidth=640&shape=thumb&fidelity=medium https://i.imgur.com/Hla7cyT_d.webp?maxwidth=640&shape=thumb&... Because who would want to be able to see the whole image?
- brandnewaccount 4y agostill blurry to me
- Oxidation 4y agoDid you change the value of max width? Eg https://i.imgur.com/Hla7cyT_d.webp?maxwidth=6400 https://i.imgur.com/Hla7cyT_d.webp?maxwidth=6400
- NackerHughes 4y agoHere's a link to the proper version: https://i.imgur.com/Hla7cyT_d.png?maxwidth=999999 https://i.imgur.com/Hla7cyT_d.png?maxwidth=999999
- bko 4y agoBut I don't want a specific timezone. I want it to ignore the timezone. I knew it was being thrown off by timezone but was unsure why. This is one of dozens sometimes hundreds of questions I need answers to every day and want to minimize the friction. I don't want to have to read this unless I don't have to. Sure sometimes if its important enough or I'm curious, but the ChatGPT answer was much better for me. And I get by fine on Google otherwise function convertTZ(date, tzString) { return new Date((typeof date === "string" ? new Date(date) : date).toLocaleString("en-US", {timeZone: tzString})); } // usage: Asia/Jakarta is GMT+7 convertTZ("2012/04/20 10:10:30 +0000", "Asia/Jakarta") // Tue Apr 20 2012 17:10:30 GMT+0700 (Western Indonesia Time) // Resulting value is regular Date() object const convertedDate = convertTZ("2012/04/20 10:10:30 +0000", "Asia/Jakarta") convertedDate.getHours(); // 17 // Bonus: You can also put Date object to first arg const date = new Date() convertTZ(date, "Asia/Jakarta") // current date-time in jakarta.
- agilob 4y agoReading documentation instead clicking first SO link or writing 6 lines to a bot? You must be crazy!