Created
March 1, 2021 11:35
-
-
Save Alkimisti/27cc2b245d7e978155934b013186d04a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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