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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user