[rrd-users] RRDTool time format

Joe Loiacono jloiacon at csc.com
Mon Aug 13 23:25:48 CEST 2007


rrd-users-bounces at lists.oetiker.ch wrote on 08/05/2007 11:53:38 PM:

> 
> Hello everyone :)
> 
> I'm having problems in creating a timestamp with a given long value. I 
got
> the long value by using  a simple rrdtool command, which is "rrdtool 
info
> <table_name>.rrd" and I look for the row that showsl "last_update  =
> 1186372065"   and 

>epoch_to_date_gm 1186372065
epoch_date = 1186372065;   date = 08/06/2007 03:47:45 (GMT)

> get the number. I'm pretty sure it is correct (Am I not ?).
> 
> this is the code that I wrote :
> 
> import  java.sql.Timestamp;

Maybe the SQL timestamp is different from Unix time (i.e., seconds since 
1970). RRDtool will use Unix time (if you're on Unix.)

> 
> ...
> System.out.println(new Timestamp (1186364206).toString());
> ...
> 
> the output : 
> 
> 
> 1970-01-15 01:02:44.206
> 
> It seems to be wrong, since the table was updated about one minute 
earlier
> before I wrote the code. The weird thing is, when I typed 
> 
> System.out.println(System.currentTimeMillis().getTime());
> 
> the output :
> 
> 1186370094158 <== this long value is much longer than the one I got from 
the

1186370094158 is not a valid time.

> database (1186364206) and I wonder why

>epoch_to_date_gm 1186364206
epoch_date = 1186364206;   date = 08/06/2007 01:36:46 (GMT)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20070813/3655377c/attachment.html 


More information about the rrd-users mailing list