To convert Australian Eastern Daylight Time (AEDT) to GMT, one approach is to use Moment.js, a popular JavaScript date and time library. Here's how to do it in TypeScript:
index.ts500 chars16 lines
In this example, we first import the moment-timezone
library. We then set the input timezone to Australia/Sydney
, which is the timezone for AEDT. We create a moment
object with the input datetime in AEDT, and then use the tz
method to convert it to GMT. Finally, we format the output datetime as a string and print it to the console.
Note that Moment.js uses the IANA Time Zone database, which contains a comprehensive list of time zones and their corresponding offsets from UTC/GMT.
gistlibby LogSnag