snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 81538904210e9092760ce7c6b043eaaa166509b6
parent 29c9d6c166206f06c138c65b23c92f1b1db419a4
Author: default <nobody@localhost>
Date:   Sun, 13 Apr 2025 14:12:37 +0200

More timezone tweaks.

Diffstat:
Mhtml.c | 2+-
Mxs_time.h | 38++++++++++++++++++++++++++++++--------
2 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/html.c b/html.c @@ -4369,7 +4369,7 @@ int html_post_handler(const xs_dict *req, const char *q_path, if (t != 0) { const char *tz = xs_dict_get_def(snac.config, "tz", "UTC"); - t += xs_tz_offset(tz); + t -= xs_tz_offset(tz); xs *iso_date = xs_str_iso_date(t); msg = xs_dict_set(msg, "published", iso_date); diff --git a/xs_time.h b/xs_time.h @@ -116,7 +116,36 @@ struct { const char *tz; /* timezone name */ float h_offset; /* hour offset */ } xs_tz[] = { - { "UTC", 0 }, + { "UTC", 0 }, + { "WET (Western European Time)", 0 }, + { "WEST (Western European Summer Time)", 1 }, + { "CET (Central European Time)", 1 }, + { "CEST (Central European Summer Time)", 2 }, + { "EET (Eastern European Time)", 2 }, + { "EEST (Eastern European Summer Time)", 3 }, + { "MSK (Moskow Time Zone)", 3 }, + { "EST (Eastern Time Zone)", -5 }, + { "AST (Atlantic Time Zone)", -4 }, + { "ADT (Atlantic Daylight Time Zone)", -3 }, + { "CST (Central Time Zone)", -6 }, + { "CDT (Central Daylight Time Zone)", -5 }, + { "MST (Mountain Time Zone)", -7 }, + { "MDT (Mountain Daylight Time Zone)", -6 }, + { "PST (Pacific Time Zone)", -8 }, + { "PDT (Pacific Daylight Time Zone)", -7 }, + { "AKST (Alaska Time Zone)", -9 }, + { "AKDT (Alaska Daylight Time Zone)", -8 }, + { "China Time Zone", 8 }, + { "IST (Israel Standard Time)", 2 }, + { "IDT (Israel Daylight Standard Time)", 3 }, + { "WITA (Western Indonesia Time)", 8 }, + { "AWST (Australian Western Time)", 8 }, + { "ACST (Australian Eastern Time)", 9.5 }, + { "ACDT (Australian Daylight Eastern Time)", 10.5 }, + { "AEST (Australian Eastern Time)", 10 }, + { "AEDT (Australian Daylight Eastern Time)", 11 }, + { "NZST (New Zealand Time)", 12 }, + { "NZDT (New Zealand Daylight Time)", 13 }, { "GMT", 0 }, { "GMT+1", -1 }, { "GMT+2", -2 }, @@ -144,13 +173,6 @@ struct { { "GMT-12", 12 }, { "GMT-13", 13 }, { "GMT-14", 14 }, - { "GMT-15", 15 }, - { "WET", 0 }, - { "CET", -1 }, - { "AST", -4 }, - { "CST", -6 }, - { "MST", -7 }, - { "PST", -8 }, { NULL, 0 } };