Hi Simon,

I would use


perl -e 'print "".localtime(time - time % 300)'



> 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:[EMAIL PROTECTED]
> Help        mailto:[EMAIL PROTECTED]
> Archive     http://lists.ee.ethz.ch/rrd-users
> WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi
>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://tobi.oetiker.ch [EMAIL PROTECTED] ++41 62 213 9902

--
Unsubscribe mailto:[EMAIL PROTECTED]
Help        mailto:[EMAIL PROTECTED]
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

Reply via email to