Here you can find the source of toTimestampFromLong(long millis)
millis
, which denotes the point in time that many milliseconds since the epoch; returns null
if millis
is negative.
public static Timestamp toTimestampFromLong(long millis)
//package com.java2s; import java.sql.Timestamp; public class Main { /**/*from w ww . jav a 2s.com*/ * Returns the Timestamp corresponding to <code>millis</code>, which denotes * the point in time that many milliseconds since the epoch; returns <code>null</code> * if <code>millis</code> is negative. */ public static Timestamp toTimestampFromLong(long millis) { if (millis < 0) { return null; } return new Timestamp(millis); } }