Home > Back-end >  SimpleDateFormat (HH: mm "). The parse (12:56) how to get in the day time
SimpleDateFormat (HH: mm "). The parse (12:56) how to get in the day time

Time:12-02

 String stringData1="12:56"; 
SimpleDateFormat SDF=new SimpleDateFormat (HH: mm ");
The Date date2=SDF. Parse (stringData1);
System. The out. Println (date2);

The results for the
 Thu Jan 01 12:56:00 CST 1970 

How to operate to get the date in the day

CodePudding user response:


Joda - time
Joda - time
2.10.6 & lt;/version>


https://blog.csdn.net/sheep8521/article/details/88527875

CodePudding user response:

String stringData1="12:56";
SimpleDateFormat SDF=new SimpleDateFormat (" yyyy - MM - dd HH: MM ");
The Date date2=SDF. Parse (LocalDate. Now (). The toString () + "" + stringData1);
System. The out. Println (date2);
  • Related