Home > Back-end >  Me the about time conversion of what went wrong?
Me the about time conversion of what went wrong?

Time:09-27

 
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 information
The 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:

rates quoted 2 floor uncle plantain response:

Novices, on dd MM yyyy years such


Thank you, the original have to throw an exception
  • Related