deciphering omapi timestamps
Niall O'Reilly
Niall.oReilly at ucd.ie
Wed Dec 6 22:18:57 UTC 2006
On 6 Dec 2006, at 18:19, Duane Cox wrote:
> ends = 45:77:17:9e
[ ... ]
> Is there any way to rewrite the timestamps for the lease ends/
> starts times into a human readable form?
Not within what bash alone can do for you.
Working on your 'ends' value, and guessing
it's a 32-bit integer gives the following.
dhcp-189(niall)3: pint
pint> $foo = "45:77:17:9e"
45:77:17:9e
pint> $foo =~ s/://g
3
pint> join(':', gmtime(hex $foo))
54:18:19:6:11:106:3:339:0
pint> ^D
dhcp-189(niall)4:
That looks like Wed, 06 Dec 2006 19:18:54 (7:18:54 pm).
/Niall
alias pint='perl -ne '\''sub BEGIN {print "pint> "} sub END {print
"\n"} printf "%s\npint> ",eval'\'''
More information about the dhcp-users
mailing list