0
我收到設備的當前日期,但我想的日期和城市迪拜的時候,任何一個請幫我做this.when活動叫的日期和時間應顯示, 任何幫助將appriciated。謝謝你..如何在Android上獲取當前迪拜的日期和時間?
我收到設備的當前日期,但我想的日期和城市迪拜的時候,任何一個請幫我做this.when活動叫的日期和時間應顯示, 任何幫助將appriciated。謝謝你..如何在Android上獲取當前迪拜的日期和時間?
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date parsed = format.parse("2011-03-01 15:10:37");
// => This time is in the user phone timezone, you will maybe need to turn it in UTC!
TimeZone tz = TimeZone.getTimeZone("Asia/Dubai");
format.setTimeZone(tz);
String result = format.format(parsed);
您可以使用TimeZone
傳遞給SimpleDateFormat
SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.US);
sdf.setTimeZone(TimeZone.getTimeZone("Asia/Dubai"));
難道我的回答幫助你的?如果您需要更多信息,請詢問。 –