mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Implement Category Lists editor to manage ip/domain lists
This commit is contained in:
parent
19a4b03478
commit
6bbb828ead
13 changed files with 558 additions and 54 deletions
|
|
@ -2751,6 +2751,17 @@ end
|
|||
|
||||
-- ####################################################
|
||||
|
||||
function getTzOffsetSeconds()
|
||||
local now = os.time()
|
||||
local local_t = os.date("*t", now)
|
||||
local utc_t = os.date("!*t", now)
|
||||
local delta = (local_t.hour - utc_t.hour)*60 + (local_t.min - utc_t.min)
|
||||
|
||||
return(delta*60)
|
||||
end
|
||||
|
||||
-- ####################################################
|
||||
|
||||
function makeTimeStamp(d, tzoffset)
|
||||
-- tzoffset is the timezone difference between UTC and Local Time in the browser
|
||||
local pattern = "(%d+)%/(%d+)%/(%d+) (%d+):(%d+):(%d+)"
|
||||
|
|
@ -2764,11 +2775,7 @@ function makeTimeStamp(d, tzoffset)
|
|||
timestamp = timestamp - (tzoffset or 0)
|
||||
|
||||
-- from UTC to machine local time
|
||||
local now = os.time()
|
||||
local local_t = os.date("*t", now)
|
||||
local utc_t = os.date("!*t", now)
|
||||
local delta = (local_t.hour - utc_t.hour)*60 + (local_t.min - utc_t.min)
|
||||
delta = delta * 60 -- to seconds
|
||||
local delta = getTzOffsetSeconds()
|
||||
|
||||
timestamp = timestamp + (delta or 0)
|
||||
-- tprint("delta: "..delta.." tzoffset is: "..tzoffset)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue