java格式化时间


public void static main(String[]args){

// System.out.println(System.currentTimeMillis());
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MMM-dd HH:mm:ss:SSS");
String formatStr =formatter.format(new Date());
System.out.println(formatStr);//2017-九月-15 13:17:08:355

SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS");
String formatStr2 =formatter2.format(new Date());
System.out.println(formatStr2);//2017-09-15 13:18:44:672

{

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM