📜  java getTime - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:24.265000             🧑  作者: Mango

代码示例1
String formatCode = "yyyy-MM-dd 'at' HH:mm:ss z"; // Example
SimpleDateFormat formatter = new SimpleDateFormat(formatCode); // Time Formatter
Date date = new Date(System.currentTimeMillis);

String time = formatter.format(date);
// e.g. time = 2021-04-15 at 11:11:11 UTC