62,614
社区成员
发帖
与我相关
我的任务
分享
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class SimpleTime {
public static void main(String[] args) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
try {
Date currentTime = format.parse("2009-09-12 13:04:54");
System.out.println(currentTime);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
SimpleDateFormat format = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");