Android在代码中获取当前系统的时间并格式化

来源:互联网 发布:教美术的软件 编辑:程序博客网 时间:2024/05/29 06:41
private String getTime() {    long time = System.currentTimeMillis();//long now = android.os.SystemClock.uptimeMillis();    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS");    Date d1 = new Date(time);    String t1 = format.format(d1);    return t1;

}

阅读全文
0 0
原创粉丝点击