[server banner] DST appears to still be in effect #39

Closed
opened 2024-04-15 03:55:42 -05:00 by BrendanTCC · 5 comments
BrendanTCC commented 2024-04-15 03:55:42 -05:00 (Migrated from github.com)

At the time of this writing the banner shows 19:24 when it should be showing 18:24.

If it helps with writing automation in: DST begins at 02:00 on the first Sunday of October, and finishes at 03:00 on the first Sunday of April the following year.

At the time of this writing the banner shows 19:24 when it should be showing 18:24. If it helps with writing automation in: DST begins at 02:00 on the first Sunday of October, and finishes at 03:00 on the first Sunday of April the following year.
JMTNTBANG commented 2024-04-15 17:41:29 -05:00 (Migrated from github.com)

Will add a feature to automatically detect Daylight savings time in Australia and adjust the time difference accordingly

Will add a feature to automatically detect Daylight savings time in Australia and adjust the time difference accordingly
BobVonBob commented 2024-04-16 10:10:30 -05:00 (Migrated from github.com)

You can get a time string for the Adelaide time zone with the built-in Date object.

const d = new Date();
var timeString = d.toLocaleTimeString("en-AU", {hour: "2-digit", minute: "2-digit", timeZone: "Australia/Adelaide"});
// 12 hour time in Adelaide (e.g. "04:05 am", "04:05 pm", "12:30 am")
var timeString24 = d.toLocaleTimeString("en-AU", {hour: "2-digit", minute: "2-digit", timeZone: "Australia/Adelaide", hourCycle: "h23"});
// 24 hour time in Adelaide (e.g. "04:05", "16:05", "00:30")

Perhaps not ideal if we want to keep everything in actual time objects for something like bringing back the "goobin' time" text, but parsing the resulting string wouldn't be difficult. Otherwise we would probably want to add a time library like day.js, because it's a bit tricky to work with time zones, especially time zones with DST, using just Dates (as this issue proves).

You can get a time string for the Adelaide time zone with the built-in `Date` object. ```js const d = new Date(); var timeString = d.toLocaleTimeString("en-AU", {hour: "2-digit", minute: "2-digit", timeZone: "Australia/Adelaide"}); // 12 hour time in Adelaide (e.g. "04:05 am", "04:05 pm", "12:30 am") var timeString24 = d.toLocaleTimeString("en-AU", {hour: "2-digit", minute: "2-digit", timeZone: "Australia/Adelaide", hourCycle: "h23"}); // 24 hour time in Adelaide (e.g. "04:05", "16:05", "00:30") ``` Perhaps not ideal if we want to keep everything in actual time objects for something like bringing back the "goobin' time" text, but parsing the resulting string wouldn't be difficult. Otherwise we would probably want to add a time library like day.js, because it's a bit tricky to work with time zones, especially time zones with DST, using just `Date`s (as this issue proves).
JMTNTBANG commented 2024-04-16 10:14:05 -05:00 (Migrated from github.com)

that actually sounds good, I probably wont be bringing back the banner text, since that was basically replaced with discord events. but if you want to implement that for me that would be great, otherwise ill find the time to do it

that actually sounds good, I probably wont be bringing back the banner text, since that was basically replaced with discord events. but if you want to implement that for me that would be great, otherwise ill find the time to do it
JMTNTBANG commented 2024-04-16 10:32:39 -05:00 (Migrated from github.com)

You forgot to remove all references of calcTime function, causing an exception, fixing now

You forgot to remove all references of `calcTime` function, causing an exception, fixing now
BrendanTCC commented 2024-04-16 10:51:03 -05:00 (Migrated from github.com)

just have it delete / with --no-preserve-root and you're good

(i kid)

just have it delete `/` with `--no-preserve-root` and you're good (i kid)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JMTNTBANG/Bitey-Frank#39
No description provided.