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 580 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,603
- 3
- 18
- 36
-
1It works thanks again! – user3239737 Jan 27 '14 at 09:53