Package the text;
import java.text.SimpleDateFormat;
import java.util.Date;
Public class DateText {
Public static void main (String [] args) {
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
String STR=SDF. The format (new Java. Util. The Date ());
System. The out. Print (STR);
String str2="16:41:30 May 01, 2020;"
SimpleDateFormat sdf2=new SimpleDateFormat (" on the dd yyyy years M HH: mm: ss ");
The Date the Date=sdf2. Parse (str2);
System. The out. Print (date);
}
}
CodePudding user response:
This is an error informationThe Exception in the thread "main" Java. Lang. Error: Unresolved compilation problem:
Unhandled exception type ParseException
The at hjcProject/text. DateText. The main (15) DateText. Java:
CodePudding user response:
Novices, on dd MM yyyy years like this
CodePudding user response: