Nmap Development mailing list archives

Re: [NSE] ip-geolocation


From: Toni Ruottu <toni.ruottu () iki fi>
Date: Fri, 17 Jun 2011 22:20:47 +0300

Could this problem be related to the daylight savings?
http://en.wikipedia.org/wiki/Daylight_saving_time

On Fri, Jun 17, 2011 at 2:48 PM, Gorjan Petrovski <mogi57 () gmail com> wrote:
Well it seems there is some kind of a problem with the os.time()
function when a table is passed to it. The result is one hour less
than it should be (one hour less than the time in the table supplied).

Should I leave the gmtime() function in place and commit the script as is?

Should I diagnose and fix the problem with the os.time() function or
should I leave that to the bug wranglers?

Cheers,
Gorjan

On Tue, Jun 14, 2011 at 2:36 PM, Gorjan Petrovski <mogi57 () gmail com> wrote:
o The gmtime() function can simply be:

os.time(os.date("!*t"))

I think there was also an error somewhere in your gmtime function
because the two produce different results.

The results are off by one hour. AFAIK my calculations are ok, unless
my mind's slipped :P
The os.time(os.date("!*t")) doesn't give the time which may be used by
the Quova API, the gmtime() and ostime() functions do. I'll research
this a bit later, I've left the gmtime() as is. I'd like to explore
lldp and lltd before the meeting.

o The name for your "const" table worries me. Can you change it to
something else that doesn't resemble a C keyword? :)

Done.

Overall I like the script. Is there a reason you didn't elect to go
with separate scripts with "subnames"

That was a good idea that I overlooked. As you may notice by the
attachments I've split the files.

Gorjan Petrovski




--
Gorjan

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: