Module:Time/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 443:
args.test_time = args._TEST_TIME_
end
local arg_index = {'year','month','day','hour','min','sec'} -- ISO 8601
local arguments = {['year']=nil,['month']=nil,['day']=nil,['hour']=nil,['min']=nil,['sec']=nil} -- ISO 8601
local i = 1
for val in string.gmatch(args.test_time, "%d+") do -- extract values
arguments[arg_index[i]] = val
i = i + 1
end
if not arguments.day then -- required by os.time
return error_msg ('test_time') -- return error
end
utc_timestamp = os.time(arguments); -- get timestamp of test_time
else
utc_timestamp = os.time (); -- get current server time (UTC)