mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00

This is so that people working from the current stable version can still start using git.
19 lines
359 B
Python
19 lines
359 B
Python
#! /usr/bin/env python
|
|
#
|
|
# Prints a Unix timestamp $1 in the format Bro uses for its rotation timestamps.
|
|
|
|
fmt="%y-%m-%d_%H.%M.%S" # From rotate-logs.bro
|
|
|
|
import sys
|
|
import time
|
|
|
|
if len(sys.argv) != 2:
|
|
print >>sys.stderr, "usage: fmt-time unix-timestamp"
|
|
sys.exit(1)
|
|
|
|
t = float(sys.argv[1])
|
|
|
|
print time.strftime(fmt, time.localtime(int(t)))
|
|
|
|
|
|
|