Simplify applying offset

This commit is contained in:
Nathan Fisher 2023-06-13 01:40:56 -04:00
parent fb6f60d4ec
commit c5356568aa

View File

@ -280,10 +280,7 @@ pub const DateTime = struct {
if (self.second) |s| { if (self.second) |s| {
seconds += s; seconds += s;
} }
switch (self.tz) { if (self.getOffset()) |ofs| seconds -= ofs.asSeconds();
.utc => {},
.offset => |ofs| seconds -= ofs.asSeconds(),
}
return seconds; return seconds;
} }
}; };