![java setdate java setdate](https://image.slidesharecdn.com/java8dateandtimeapi-140318220916-phpapp02/95/java-8-date-and-time-api-12-638.jpg)
Use class if you need to extract year, month, day, hour, minute, and second, or manipulating these field (e.g., 7 days later, 3 weeks earlier). You could use SimpleDateFormat to control the date/time display format.Date class is sufficient if you just need a simple timestamp.("Format 2: " + dateFormatter.format(now)) ĭateFormatter = new SimpleDateFormat("EEEE, MMMM d, yyyy") ("Format 1: " + dateFormatter.format(now)) ĭateFormatter = new SimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz") SimpleDateFormat dateFormatter = new SimpleDateFormat("E, y-M-d 'at' h:m:s a z")
JAVA SETDATE FULL
3M: (in text xxx), >3M: (in full text full) M (month): M (in number), MM (in number with leading zero) E (day of week): 3E or fewer (in text xxx), >3E (in full text)
![java setdate java setdate](https://i.pinimg.com/originals/04/bb/6e/04bb6e046ce919a6c553c53dfd58f688.jpg)
("toString(): " + now) // dow mon dd hh:mm:ss zzz yyyy // SimpleDateFormat can be used to control the date/time display format: You can use SimpleDateFormat to control the display format. The Date's toString() method has a fixed date/time display format. Take note that although Date is represented based on the absolute epoch, the toString() displays the local time, according to the default time zone. String toString(): returns a date/time string in local time-zone using the default locale in the format: dow mon dd hh:mm:ss zzz yyyy, where dow is the day of week (Sun.
![java setdate java setdate](https://i.stack.imgur.com/fzVwe.png)