mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Remove unused function
This commit is contained in:
parent
38f64e0a72
commit
57c7abccfb
3 changed files with 3 additions and 34 deletions
|
|
@ -2558,38 +2558,6 @@ end
|
|||
|
||||
-- ####################################################
|
||||
|
||||
local cached_tz_offset_secs = nil
|
||||
|
||||
-- Get the local (backend) timezone offset in seconds
|
||||
function getTzOffsetSeconds()
|
||||
if(cached_tz_offset_secs ~= nil) then
|
||||
return(cached_tz_offset_secs)
|
||||
end
|
||||
|
||||
local now = os.time()
|
||||
local local_t = os.date("*t", now)
|
||||
local utc_t = os.date("!*t", now)
|
||||
local delta = os.time(local_t) - os.time(utc_t)
|
||||
|
||||
if utc_t.isdst then
|
||||
-- DST is the practice of advancing clocks during summer months
|
||||
-- so that evening daylight lasts longer, while sacrificing normal sunrise times.
|
||||
-- utc_t is increased by one hour when the time is DST.
|
||||
-- For example, an GMT time of 2pm would be reported by lua as 3pm with
|
||||
-- the isdst flag set.
|
||||
-- For this reason, we need to add back the hour to the computed delta.
|
||||
delta = delta + 3600
|
||||
end
|
||||
|
||||
-- tprint(string.format("local_t %u [%s][isdst: %s]", os.time(local_t), formatEpoch(os.time(local_t)), local_t.isdst))
|
||||
-- tprint(string.format("utc_t %u [%s][isdst: %s]", os.time(utc_t), formatEpoch(os.time(utc_t)), utc_t.isdst))
|
||||
|
||||
cached_tz_offset_secs = delta
|
||||
return delta
|
||||
end
|
||||
|
||||
-- ####################################################
|
||||
|
||||
-- @brief Get the frontend timezone offset in seconds
|
||||
-- @return The offset of the frontend timezone
|
||||
function getFrontendTzSeconds()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue