Skip to content

Instantly share code, notes, and snippets.

@Alkimisti
Created March 1, 2021 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Alkimisti/27cc2b245d7e978155934b013186d04a to your computer and use it in GitHub Desktop.
Save Alkimisti/27cc2b245d7e978155934b013186d04a to your computer and use it in GitHub Desktop.
import java.sql.Timestamp;
import java.util.Date;
public class TimestampToDate {
public static void main(String[] args) {
Timestamp ts = new Timestamp(System.currentTimeMillis());
System.out.println(ts);
Date date = new Date(ts.getTime());
System.out.println(date);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment