Module:Time/sandbox: Difference between revisions

Content deleted Content added
use Module:Yesno for booleans instead of string comparisons
use Module:Yesno to check boolean value of variable "DST"; check for 'always' needs to go up
Line 424:
timestamp = utc_timestamp + utc_offset; -- make local time timestamp
 
if 'noalways' == DST then -- forif timezonesneeded thatto DOalways observedisplay dst but for this ___location ...time
tz_abbr = tz.abbr; -- ... dst is not observed (|dst=no) show time as standard time
elseif 'always' == DST then -- if needed to always display dst time
timestamp = timestamp + 3600; -- add a hour for dst
tz_abbr = tz.dst_abbr; -- dst abbreviation
elseif not yesno(DST) then -- for timezones that DO observe dst but for this ___location ...
tz_abbr = tz.abbr; -- ... dst is not observed (|dst=no) show time as standard time
else
if is_set (tz.dst_begins) and is_set (tz.dst_ends) and is_set (tz.dst_time) then -- make sure we have all of the parts