[rrd-users] Re: How to calculate current time in seconds?

David Perel davidp at oak.njit.edu
Wed Oct 29 16:33:30 MET 2003


} From rrd-users-bounce at list.ee.ethz.ch Wed Oct 29 10:25:07 2003
} X-Original-To: rrd-users at list.ee.ethz.ch
} Delivered-To: slist+rrd-users at ee.ethz.ch
} X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1
} content-class: urn:content-classes:message
} MIME-Version: 1.0
} Subject: [rrd-users] How to calculate current time in seconds?
} X-MS-Has-Attach: 
} X-MS-TNEF-Correlator: 
} Thread-Topic: [rrd-users] RRD perl module build error on OS X 10.3 Panther
} Thread-Index: AcOeEij/jAqB6vw/SuWsCe6xBodhHgAHLX6A
} To: <rrd-users at list.ee.ethz.ch>
} X-OriginalArrivalTime: 29 Oct 2003 15:24:33.0443 (UTC) FILETIME=[C141A730:01C39E30]
} X-Virus-Scanned: by amavisd-new at ee.ethz.ch
} X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on 
} 	ntardis.ee.ethz.ch
} X-Spam-Level: 
} X-Spam-Status: No, hits=-4.9 required=10.0 tests=BAYES_00 autolearn=ham 
} 	version=2.60
} X-archive-position: 6884
} X-ecartis-version: Ecartis v1.0.0
} X-original-sender: Charles.Li at dep.state.fl.us
} X-list: rrd-users
} X-Virus-Scanned: by amavisd-new at ee.ethz.ch
} Content-Transfer-Encoding: 8bit
} X-MIME-Autoconverted: from quoted-printable to 8bit by jsbach.njit.edu id h9TFP7fS029680
} 
} I want to make a graph from 6am today to now.
} How do I get the current time in seconds from a shell script?
} Thanks, Charles
} 
} --
} Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
} Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
} Archive     http://www.ee.ethz.ch/~slist/rrd-users
} WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
} 
} 

Charles -- 2 ways:

#!/bin/ksh

print -n "\nUsing /usr/bin/date : "
/usr/bin/truss /usr/bin/date 2>&1 | /usr/bin/awk '/^time/ {print $NF}'

print -n "\nUsing perl : "
/usr/local/bin/perl -e 'print time, "\n" '

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list