Getting year-month-date from JS dates
If you ever find yourself in a situation where you need to extract only the year, month, and day from a JavaScript date object, here’s a simple solution. Let’s say you want today’s date in the following format: 2023-01-20T07:00:00+02:00. You want the time portion (T07:00:00+02:00) to always remain the same, but the date part should reflect the current date. The toISOString() method of the JavaScript Date object can give you the complete date and time in the following format: 2023-01-10T07:35:37....