If your real goal is to serialize a Date
object for some kind of custom made persistence or data transfer, a simple solution would be:
Date d = new Date();
long l = d.getTime();
Date theSameDate = new Date(l);
More Related Contents:
- Adding iterations together in Java
- String simplify 3x count and print charcters Java program
- Manipulating an Access database from Java without ODBC
- Is there a difference between x++ and ++x in java?
- rotating coordinate plane for data and text in Java
- How to pass an ArrayList to a varargs method parameter?
- How do I add a Maven dependency in Eclipse?
- Size of a byte in memory – Java
- What does the “assert” keyword do? [duplicate]
- JDK dateformatter parsing DayOfWeek in German locale, java8 vs java9
- A Java API to generate Java source files [closed]
- Convert Epoch seconds to date and time format in Java
- Differences between “java -cp” and “java -jar”?
- Remove trailing zero in Java
- Java: getMinutes and getHours
- Why can array constants only be used in initializers? [duplicate]
- How do I make a list with checkboxes in Java Swing?
- JSON parameter in spring MVC controller
- Zoom box for area around mouse location on screen [closed]
- Printing *s as triangles in Java?
- “SetPropertiesRule” warning message when starting Tomcat from Eclipse [duplicate]
- connecting to shared folder in windows with java
- Android and getting a view with id cast as a string
- How can I set the priority mouse listener
- How to use session in JSP pages to get information?
- How to create ArrayList (ArrayList) from array (int[]) in Java
- Allure report: nothing shown in Chrome
- Android View Disappearing When Go Outside Of Parent
- Integration Test with Spring Boot and Spock
- SSLPeerUnverifiedException: peer not authenticated