[rrd-users] Re: Help with Bash script to calc end-time in multiples of 300 ?

Simon Hobson linux at thehobsons.co.uk
Sat Nov 18 10:32:15 MET 2006


Rob Conway wrote:

>I just use "date +%s" to get the unix time but how can I easily 
>round this value ?

etime=`date +%s`
step=300
etime=$(( ${etime} - ( ${etime} % ${step} ) ))

Now, can someone show me how to convert the resulting end time to a 
human readable form - eg so I can use it in a gprint statement ?

--
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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list