Wrapping up for the night. Better alerts and things with the correct timezone...

This commit is contained in:
Scott Idem
2024-10-17 20:46:39 -04:00
parent 172763bc26
commit de24f0dc80
4 changed files with 25 additions and 6 deletions

View File

@@ -131,8 +131,8 @@ async function handle_qry__event_file(
// It is very important to know that all of the created_on and updated_on timestamps are in ET timezone. Sorry...?
let for_et_tz_datetime = new Date(current_datetime.toLocaleString('en-US', {timeZone: 'America/New_York'}));
const offset_minutes = for_et_tz_datetime.getTimezoneOffset();
const adjusted_for_et_tz_datetime = new Date(for_et_tz_datetime.getTime() - offset_minutes * 60 * 1000);
const adjust_minutes = for_et_tz_datetime.getTimezoneOffset(); // Usually 240 minutes for ET.
const adjusted_for_et_tz_datetime = new Date(for_et_tz_datetime.getTime() - adjust_minutes * 60 * 1000);
const adjusted_for_et_tz_datetime_iso_str = adjusted_for_et_tz_datetime.toISOString().slice(0, -1);
console.log(`Adjusted for ET TZ time:`, adjusted_for_et_tz_datetime_iso_str);