<br><font size=2><tt>rrd-users-bounces@lists.oetiker.ch wrote on 08/05/2007
11:53:38 PM:<br>
<br>
> <br>
> Hello everyone :)<br>
> <br>
> I'm having problems in creating a timestamp with a given long value.
I got<br>
> the long value by using a simple rrdtool command, which is "rrdtool
info<br>
> <table_name>.rrd" and I look for the row that showsl "last_update
=<br>
> 1186372065" and </tt></font>
<br>
<br><font size=2><tt>>epoch_to_date_gm 1186372065</tt></font>
<br><font size=2><tt>epoch_date = 1186372065; date = 08/06/2007
03:47:45 (GMT)</tt></font>
<br><font size=2><tt><br>
> get the number. I'm pretty sure it is correct (Am I not ?).<br>
> <br>
> this is the code that I wrote :<br>
> <br>
> import java.sql.Timestamp;</tt></font>
<br>
<br><font size=2><tt>Maybe the SQL timestamp is different from Unix time
(i.e., seconds since 1970). RRDtool will use Unix time (if you're on Unix.)</tt></font>
<br><font size=2><tt><br>
> <br>
> ...<br>
> System.out.println(new Timestamp (1186364206).toString());<br>
> ...<br>
> <br>
> the output : <br>
> <br>
> <br>
> 1970-01-15 01:02:44.206<br>
> <br>
> It seems to be wrong, since the table was updated about one minute
earlier<br>
> before I wrote the code. The weird thing is, when I typed <br>
> <br>
> System.out.println(System.currentTimeMillis().getTime());<br>
> <br>
> the output :<br>
> <br>
> 1186370094158 <== this long value is much longer than the one I
got from the</tt></font>
<br>
<br><font size=2><tt>1186370094158 is not a valid time.</tt></font>
<br><font size=2><tt><br>
> database (1186364206) and I wonder why</tt></font>
<br>
<br><font size=2><tt>>epoch_to_date_gm 1186364206</tt></font>
<br><font size=2><tt>epoch_date = 1186364206; date = 08/06/2007
01:36:46 (GMT)</tt></font>
<br>
<br><font size=2><tt><br>
</tt></font>