posted 8 years ago
DateFormat format = new SimpleDateFormat("hh:mm:ss");
Date now = format.parse("01:01:01");
Calendar cal = Calendar.getInstance();
cal.setTime(now);
System.out.println(cal.getTime());
It prints Mon Jan 01 01:01:01 IST 1970. How to print current date with specified hour, minute and seconds ?