📜  如何在 android studio 中设置当前日期 - Java 代码示例

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

代码示例1
Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String strDate = sdf.format(c.getTime());
Log.d("Date","DATE : " + strDate)