Module:Time/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 389:
7. |hide-tz = when set to 'yes' removes the timezone name
8. |unlink-tz = when set to 'yes' unlinks the timzone name
9. |_TEST_TIME_time = a specific utc time in ISO date time format used for testing this code
TODO: convert _TEST_TIME_ to |time=?
 
Timezone abbreviations can be found here: [[List_of_time_zone_abbreviations]]
Line 399 ⟶ 397:
local function time (frame)
local args = getArgs (frame);
local utc_timestamp, timestamp; -- current or _TEST_TIME_time timestamps; timestamp is local ST or DST time used in output
local tz_abbr; -- select ST or DST timezone abbreviaion used in output
local time_string; -- holds output time/date in |df= format
Line 459 ⟶ 457:
DF = DF:lower(); -- normalize to lower case
 
if is_set (args.time) or is_set (args._TEST_TIME_) [[legacy parameter]] then -- typically used to test the code at a specific utc time
if not get_test_time (args.time) and not get_test_time (args._TEST_TIME_) then
return error_msg ('test_time');
end