Get current time in a given timezone : android

后端 未结 10 1978
悲哀的现实
悲哀的现实 2020-11-30 10:13

I am new to Android and I am currently facing an issue to get current time given the timezone.

I get timezone in the format \"GMT-7\" i.e. string. and I have the sys

10条回答
  •  被撕碎了的回忆
    2020-11-30 10:28

    Cleanest way is with SimpleDateFormat

    SimpleDateFormat = SimpleDateFormat("MMM\nd\nh:mm a", Locale.getDefault())
    

    or you can specify the Locale

提交回复
热议问题