Модуль:GameInfo: различия между версиями
Kirus59 (обсуждение | вклад) Новая страница: «local p = {} function p.getYear( frame ) local currentYear = os.date( "%Y" ) local gameYear = tonumber( currentYear ) + 544 return tostring( gameYear ) end return p» |
Kirus59 (обсуждение | вклад) Нет описания правки |
||
| Строка 1: | Строка 1: | ||
local p = {} | local p = {} | ||
function p.getYear( frame ) | local _gameYearOffset = 544 | ||
local | local _timezoneOffset = 3 * 3600 -- UTC+3 | ||
return tostring( gameYear ) | function p.getYear(frame) | ||
local utcTime = os.time(os.date("!*t")) | |||
local timezoneTime = utcTime + _timezoneOffset | |||
local curYear = os.date("%Y", timezoneTime) | |||
local gameYear = tonumber(curYear) + 544 | |||
return tostring(gameYear) | |||
end | end | ||
return p | return p | ||
Версия от 10:50, 22 июня 2026
Для документации этого модуля может быть создана страница Модуль:GameInfo/doc
local p = {}
local _gameYearOffset = 544
local _timezoneOffset = 3 * 3600 -- UTC+3
function p.getYear(frame)
local utcTime = os.time(os.date("!*t"))
local timezoneTime = utcTime + _timezoneOffset
local curYear = os.date("%Y", timezoneTime)
local gameYear = tonumber(curYear) + 544
return tostring(gameYear)
end
return p