import java.text.SimpleDateFormat;
import java.util.Date;
public class Q {
public static void main(String[] args) {
String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
System.out.println(date);
}
}
<script>http://blog.csdn.net/u011561335</script>
<script>http://blog.csdn.net/u011561335</script>