How-to articles, tricks, and solutions about JAVA.UTIL.DATE

Convert java.util.Date to String

To convert a java.util.Date object to a String, you can use the format method of the SimpleDateFormat class from the java.text package. The SimpleDateFormat class provides a convenient way to convert a Date object to a String based on a specified format.

How to set time zone of a java.util.Date?

To set the time zone of a java.util.Date object in Java, you can use the Calendar class.

How to subtract X day from a Date object in Java?

To subtract a certain number of days from a Date object in Java, you can use the Calendar class.