[Bro-Dev] network_time()

Gregor Maier gregor at icir.org
Thu Dec 8 13:27:31 PST 2011


On 12/8/11 13:06 , Seth Hall wrote:
>
> On Dec 8, 2011, at 3:59 PM, Gregor Maier wrote:
>
>> No. It gives seconds since epoch which is independent from the timezone (epoch is midnight 1/1/70 UTC)
>
>
> I know that epoch is like that, but network_time() give a time-typed value, not epoch time (as a count).  When I print the value with %T in a call to fmt it's coming out in local time.

Hmm. Interesting. I've actually never used %T to format at timestamp. I 
always used %f (or %d) which just prints the time in seconds since 
epoch. So I guess the problem is that %T always formats the time in 
local time.

Looks like there is a strftime() BiF, but it also uses localtime(). We 
might want to modify strftime() so one can pass an arbitrary timezone.

As for %T (and %D for that matter): Maybe either discourage it and 
always use strftime() instead or add a global that defines the timezone 
for %T/%D....


cu
Gregor
-- 
Gregor Maier
<gregor at icir.org>  <gregor at icsi.berkeley.edu>
Int. Computer Science Institute (ICSI)
1947 Center St., Ste. 600
Berkeley, CA 94704, USA
http://www.icir.org/gregor/


More information about the bro-dev mailing list