How to get current java date? I need to use it in my app for setting posting time. I tried use DateSelecter libdary but that didnt work in the way I needed I to, it printed it in a non human readable way.
Asked
Active
Viewed 586 times
1 Answers
1
You're missing the java tsg. But this is how to get thr date:
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
System.out.println(dateFormat.format(date));

Aashir
- 2,621
- 4
- 21
- 37