[mrtg] Re: converting to unix time?

Nicolas Sayer Nick at loplop.net
Wed May 15 11:02:31 MEST 2002


In-Reply-To: <016801c1f85e$cb5e3e50$7be593d8 at jim>; from jimjones at oct.net on Fri, May 10, 2002 at 03:10:56PM -0500

Perl is the way to go, and you probably have perl on Win2K since you
run MRTG?

This will do:

#!/usr/bin/perl
use Time::Local;
@day=split("-",$ARGV[0]);
@time=split(":",$ARGV[1]);

# Usage:
# ./toep.pl <date> <time>
# Exemple:
# ./toep.pl 2002-05-07 11:38:22

print timelocal($time[2], $time[1],$time[0],$day[2],$day[1]-1,$day[0]-1900);

-- 
INRIA/DirDRI/VTHD - Tél:+331 3963 5976 - Fax:+336 6344 7365 - Mob:+336 63440227
Domaine de Voluceau - B.P. 105 Rocquencourt - 78153 - Le Chesnay CEDEX - FRANCE

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list