timestamp output on rnds stats output, GRRR!

Jeff Lightner jlightner at water.com
Thu Sep 18 18:49:52 UTC 2008


If you don't have GNU Date you can convert epoch with Perl:

This little script can be used to do it:

epoch_converter.pl

#!/usr/bin/perl
print scalar localtime $ARGV[0];
print "\n"

# alternate all in one line command would be:
# perl -e 'print scalar localtime $ARGV[0];print "\n"' <epoch>
# where epoch is the epoch number of seconds input
# Simple script - shows epoch (number of seconds) for current date/time
#
perl -e 'printf "\n", printf %d, time();'
perl -e 'print time(),"\n";'

-Just run the command with the epoch number (e.g. epoch_converter.pl
1221762600)   
-Of course it doesn't need to be named epoch_converter - which is a bit
much to type every time.
-----Original Message-----
From: bind-users-bounce at isc.org [mailto:bind-users-bounce at isc.org] On
Behalf Of Hays, Ken
Sent: Thursday, September 18, 2008 2:33 PM
To: Jeff A. Earickson
Cc: bind-users at isc.org
Subject: RE: timestamp output on rnds stats output, GRRR!

If you are fortunate, your unix will have GNU date. If you have 
1221762600 epoch seconds, try

date -d '1970-01-01 Z 1221762600 seconds'
 for time zone relative display. Add the -u flag for UTC display.

Good luck, Ken

-----Original Message-----
From: bind-users-bounce at isc.org [mailto:bind-users-bounce at isc.org] On
Behalf Of Jeff A. Earickson
Sent: Thursday, September 18, 2008 1:47 PM
To: bind-users at isc.org
Subject: timestamp output on rnds stats output, GRRR!

Yo Bind Developers,

Using Bind 9.5.0-P2.  Why, oh why, does "rndc stats" give timestamp
information in UNIX epoch seconds??!!  Why can't ns_stats_dump() in
bin/named/statschannel.c do a call to localtime() or gmtime() and 
convert the UNIX epoch into a human-readable time?

Jeff Earickson
Colby College
----------------------------------
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
----------------------------------


More information about the bind-users mailing list