diff --git a/code/__DEFINES/time.dm b/code/__DEFINES/time.dm index ceb16215e40..d445b4ec461 100644 --- a/code/__DEFINES/time.dm +++ b/code/__DEFINES/time.dm @@ -10,6 +10,9 @@ /// Define that just has the current in-universe year for use in whatever context you might want to display that in. (For example, 2022 -> 2562 given a 540 year offset) #define CURRENT_STATION_YEAR (GLOB.year_integer + STATION_YEAR_OFFSET) +/// Used in the GLOB year and tgui PreInit +#define UTC_YEAR time2text(world.realtime,"YYYY",NO_TIMEZONE) + /// In-universe, SS13 is set 540 years in the future from the real-world day, hence this number for determining the year-offset for the in-game year. #define STATION_YEAR_OFFSET 540 diff --git a/code/_globalvars/time_vars.dm b/code/_globalvars/time_vars.dm index 29526f845b2..fd9b925e0d4 100644 --- a/code/_globalvars/time_vars.dm +++ b/code/_globalvars/time_vars.dm @@ -2,5 +2,5 @@ /// The difference betwen midnight (of the host computer) and 0 world.ticks. GLOBAL_VAR_INIT(timezoneOffset, 0) -GLOBAL_VAR_INIT(year, time2text(world.realtime, "YYYY", NO_TIMEZONE)) +GLOBAL_VAR_INIT(year, UTC_YEAR) GLOBAL_VAR_INIT(year_integer, text2num(year)) // = 2013??? diff --git a/code/controllers/subsystem/tgui.dm b/code/controllers/subsystem/tgui.dm index d87aa0f1dd1..ea8b02e8129 100644 --- a/code/controllers/subsystem/tgui.dm +++ b/code/controllers/subsystem/tgui.dm @@ -37,7 +37,7 @@ SUBSYSTEM_DEF(tgui) ntos_error = "" basehtml = replacetextEx(basehtml, "", ntos_error) - basehtml = replacetextEx(basehtml, "", "Nanotrasen (c) 2525-[CURRENT_STATION_YEAR]") + basehtml = replacetextEx(basehtml, "", "Nanotrasen (c) 2525-[text2num(UTC_YEAR) + STATION_YEAR_OFFSET]") // This can't use the GLOB as it runs before those are populated /datum/controller/subsystem/tgui/OnConfigLoad() var/storage_iframe = CONFIG_GET(string/storage_cdn_iframe)