android studio系统时间
时间: 2023-04-28 15:05:32 浏览: 220
Android Studio可以获取系统时间,可以使用Java中的Date类或Calendar类来获取当前时间。例如:
```java
Date date = new Date();
System.out.println(date.toString());
```
或者:
```java
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
int day = calendar.get(Calendar.DAY_OF_MONTH);
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
int second = calendar.get(Calendar.SECOND);
System.out.println(year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second);
```
这样就可以获取当前系统时间了。
阅读全文