Java获取当前日期时间

来源:互联网 发布:凡科互动 游戏源码 编辑:程序博客网 时间:2024/05/17 06:13
    public static String getNowTime(){        Date date=new Date(System.currentTimeMillis());        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");        String nowTime=simpleDateFormat.format(date);        return nowTime;    }    public static String getNowDate(){        Date date=new Date(System.currentTimeMillis());        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");        String nowDate=simpleDateFormat.format(date);        return nowDate;    }
0 0
原创粉丝点击