Just make a new Date
object with the stamp’s getTime()
value as a parameter.
Here’s an example (I use an example timestamp of the current time):
Timestamp stamp = new Timestamp(System.currentTimeMillis());
Date date = new Date(stamp.getTime());
System.out.println(date);
More Related Contents:
- Handling MySQL datetimes and timestamps in Java
- Hours and seconds are lost when storing a date in the database [closed]
- Insert & fetch java.time.LocalDate objects to/from an SQL database such as H2
- Is java.sql.Timestamp timezone specific?
- java.util.Date vs java.sql.Date
- java.util.Date format SSSSSS: if not microseconds what are the last 3 digits?
- Java: Convert String to TimeStamp
- Should I use java.util.Date or switch to java.time.LocalDate
- Java Date cut off time information
- handling DATETIME values 0000-00-00 00:00:00 in JDBC
- What is the most recommended way to store time in PostgreSQL using Java?
- Convert java.time.Instant to java.sql.Timestamp without Zone offset
- Timezones in SQL DATE vs java.sql.Date
- ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp error
- Java Timestamp – How can I create a Timestamp with the date 23/09/2007?
- Date columns in SQL-Server (MSSQL-JDBC 3.0) running under Java 1.7.0 retrieved as 2 days in the past
- java sql date time
- PreparedStatement and setTimestamp in oracle jdbc
- SQL syntax error in "insert into 'keys'(a,b,c,d,e) values(?,?,?,?,?)" [closed]
- How to get the day from timezone in java [duplicate]
- Dates with no time or timezone component in Java/MySQL
- Java: Check the date format of current string is according to required format or not [duplicate]
- Java, Calculate the number of days between two dates [duplicate]
- java.util.stream with ResultSet
- What are the date formats available in SimpleDateFormat class?
- How to start a transaction in JDBC?
- How to correctly write UTF-8 strings into MySQL through JDBC interface
- How to connect to a remote MySQL database with Java?
- Why is subtracting these two epoch-milli Times (in year 1927) giving a strange result?
- How to get jdbc connection from hibernate session? [duplicate]