1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 10:59:02 +00:00

Move date/time functions from stdnse to datetime. See #517

This commit is contained in:
dmiller
2018-08-27 22:00:10 +00:00
parent 9c3e676871
commit 46eca7f35f
35 changed files with 282 additions and 255 deletions

View File

@@ -11,6 +11,7 @@
-- @copyright Same as Nmap--See https://nmap.org/book/man-legal.html
---
local datetime = require "datetime"
local string = require "string"
local stdnse = require "stdnse"
local nmap = require "nmap"
@@ -388,12 +389,12 @@ function negotiate_v2(smb, overrides)
-- Convert the time and timezone to human readable values (taken from smb.lua)
smb['time'] = (smb['time'] // 10000000) - 11644473600
smb['date'] = stdnse.format_timestamp(smb['time'])
smb['date'] = datetime.format_timestamp(smb['time'])
-- Samba does not report the boot time
if smb['start_time'] ~= 0 then
smb['start_time'] = (smb['start_time'] // 10000000) - 11644473600
smb['start_date'] = stdnse.format_timestamp(smb['start_time'])
smb['start_date'] = datetime.format_timestamp(smb['start_time'])
else
smb['start_date'] = "N/A"
end