Home > Back-end >  Time t=new Time (); Methods the error
Time t=new Time (); Methods the error

Time:03-10

 void getTime4 () {
Time t=new Time ();///the Time t=new Time (GMT + 8 "); Along with the Time Zone information,
T.s etToNow ();//get the system time,
String time=t.y Lin ear + "years" + (t.m onth + 1) + "month", t.m onthDay + ", "our +" h "+ +, Todd Harper t.m inute +" m "+ t.s econd;
The e (" MSG ", time);
}


Search on the Internet by many such access time and formatted, but how to prompt an error on my side,

CodePudding user response:

If just for the time why not use the
 SimpleDateFormat df=new SimpleDateFormat (" MM - dd yyyy - HH: MM: ss ");//set the date format 
System. The out. Println (df) format (new Date ()));//new Date () to obtain the current system time
this? Or must use the time to get time?

CodePudding user response:

Is not the Time in the same package

CodePudding user response:

reference 1/f, gu dye dust response:
if just for the time why not use the
 SimpleDateFormat df=new SimpleDateFormat (" MM - dd yyyy - HH: MM: ss ");//set the date format 
System. The out. Println (df) format (new Date ()));//new Date () to obtain the current system time
this? Or must use the time to get time?

Date () is an error

CodePudding user response:

Import the Java. Util. Date;


The date guide package is this

CodePudding user response:




Guide a SQL and SQL complains a util util
  • Related