1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Use stdnse.format_timestamp in more places to avoid formatting issues. See #1255, #1303

This commit is contained in:
dmiller
2018-08-16 21:26:48 +00:00
parent 834e37d475
commit 6c4e02e89d
8 changed files with 13 additions and 13 deletions

View File

@@ -67,7 +67,7 @@ action = function(host, port)
if ( target.ALLOW_NEW_TARGETS ) then
target.add(node.address.host)
end
tab.addrow(response, ("%s:%d"):format(node.address.host, node.address.port), os.date("%x %X", node.ts))
tab.addrow(response, ("%s:%d"):format(node.address.host, node.address.port), stdnse.format_timestamp(node.ts))
end
if ( #response > 1 ) then

View File

@@ -74,7 +74,7 @@ action = function()
end
local ts
if ( info.timestamp and 1000 < info.timestamp ) then
ts = os.date("%x %X", info.timestamp//1000)
ts = stdnse.format_timestamp(info.timestamp//1000)
else
ts = "-"
end

View File

@@ -156,7 +156,7 @@ local function get_info_registry(host)
result['status-currentversion'], result['currentversion'] = reg_get_value(smbstate, openhklm_result['handle'], "Software\\Microsoft\\Windows NT\\CurrentVersion", "CurrentVersion")
result['status-installdate'], result['installdate'] = reg_get_value(smbstate, openhklm_result['handle'], "Software\\Microsoft\\Windows NT\\CurrentVersion", "InstallDate")
if(result['status-installdate'] ~= false) then
result['installdate'] = os.date("%Y-%m-%d %H:%M:%S", result['installdate'])
result['installdate'] = stdnse.format_timestamp(result['installdate'])
end
result['status-productname'], result['productname'] = reg_get_value(smbstate, openhklm_result['handle'], "Software\\Microsoft\\Windows NT\\CurrentVersion", "Productname")