mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Implemented date format user preference (#4399)
This commit is contained in:
parent
4f4b7a4f5d
commit
1ae418344f
3 changed files with 26 additions and 3 deletions
|
|
@ -208,9 +208,20 @@ function format_utils.formatEpoch(epoch)
|
|||
if epoch == 0 then
|
||||
return("")
|
||||
else
|
||||
local t = epoch + getFrontendTzSeconds()
|
||||
local t = epoch + getFrontendTzSeconds()
|
||||
local key = ntop.getPref('ntopng.user.' .. _SESSION["user"] .. '.date_format')
|
||||
|
||||
if(key == "little_endian") then
|
||||
-- specify the ! to indicate UTC time so that adding getFrontendTzSeconds() will give expected results
|
||||
return(os.date("!%d/%m/%Y %X", t))
|
||||
elseif( key == "middle_endian") then
|
||||
-- specify the ! to indicate UTC time so that adding getFrontendTzSeconds() will give expected results
|
||||
return(os.date("!%m/%d/%Y %X", t))
|
||||
else
|
||||
-- specify the ! to indicate UTC time so that adding getFrontendTzSeconds() will give expected results
|
||||
return(os.date("!%Y/%m/%d %X", t))
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue