Module:Time/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 522:
 
 
--[[--------------------------< U T ZC _ O F F S E T >------------------------------------------------------------
 
Mimicsimplements {{UTC offset}}

mimics templates {{Time/GMT offset}}, {{Time/EST offset}}, etc.
 
{{#invoke:Time/sandbox|tz_offset|<tz>}} – for a stand-alone invoke
Line 531 ⟶ 533:
where <tz> is a timezone abbreviation known to Module:Time/data
 
returns a UTC offset string suitable for use with the {{#time:}} parser function:
{{#time:H:i | {{#invoke:Time/sandbox|tz_offset|MST}} }}
{{#time:H:i | {{UTC_offset|MST}} }}
 
]]
 
local function tz_offsetutc_offset (frame)
local function apply_dst_ajdust (offset) -- local function to adjust standard time to daylight time; called when adjustment is needed
local hours, minutes = offset:match ('^(%-?%d%d):(%d%d)'); -- extract signed hours and minutes from specified offset
Line 606 ⟶ 610:
return {
time = time,
tz_offset = tz_offsetutc_offset,
utc_offset = utc_offset,
}