[EMAIL PROTECTED] 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)
_______________________________________________ rrd-users mailing list rrd-users@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users