I am facing problem in auto-generating date. It seems that there is no input on the date after the ID is displayed. It can be run in test class but not in main class. Can anyone help me?
System.out.println("Your generated item ID is "+itemID);
java.util.Date time = new java.util.Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
System.out.println("Enter the end time in yyyy-MM-dd HH:mm : ");
String end = a.nextLine();
Date end1 = sdf.parse(end);
// long end2 = end1.getTime();
System.out.println(sdf.format(time));
String aString = sdf.format(time);
Date now = sdf.parse(aString);