2016-11-14 47 views

回答

0
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy hh-mm a"); 
    String format = simpleDateFormat.format(new Date()); 
    Log.d("Current Time: " , format); 

這會給輸出,如:
當前時間:24-09-2017 09-19 AM

如果您想更改時間格式,請檢查以下鏈接: https://developer.android.com/reference/java/text/SimpleDateFormat.html

相關問題