符号 | 含义 |
---|---|
yyyy | 年 |
MM | 月 |
dd | 日 |
HH | 时 |
mm | 分 |
ss | 秒 |
SSS | 毫秒 |
long time = System.currentTimeMillis();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
//SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss-SSS");
String date = sdf.format(time);