时间处理工具类

时间处理工具类

package com.tools;
//时间处理类
import java.util.Date;
import java.text.SimpleDateFormat;

public class Time {
    public static String getTime(){
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time=sdf.format(new Date());
        return time;
    }
    public static String getNoFormatTime(){
        SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmsshh");
        String time=sdf.format(new Date());
        return time;
    }
}

 

posted on 2014-12-31 03:10  aicpcode  阅读(131)  评论(0编辑  收藏  举报

导航