Android開発の現地時間を取得する2つの方法

最初のタイプ:date 
Date date = new Date(System.currentTimeMillis()); //システムの現在の時刻
SimpleDateFormatdateFormat = new SimpleDateFormat( "'IMG'_yyyyMMdd_HHmmss");
dateFormat.format(date);

 

 

 

 

2番目のタイプ:カレンダー

カレンダーカレンダー=カレンダー。getInstance(); 
calendar.add(Calendar。DATE、+ 1); //向前実行一天
日付date = calendar.getTime();

おすすめ

転載: blog.csdn.net/congcongguniang/article/details/82773898