Using Joda-Time to get UTC offset for a given date and timezone

前端 未结 5 773
余生分开走
余生分开走 2021-01-01 19:03

I have dates in the format 20Jan2013, 08Aug2012 etc, with their own specific timezones. So for example, 20Jan2013 might have a timezone ID of Australia/Melbourne, and 08Aug2

5条回答
  •  一生所求
    2021-01-01 19:46

    When you know offset and timestamp so in order to get current time you can use

     public static String formatMonthDayMinuteByGivenUtcOffset(long timestamp, int offset) {
            return JODA_FORMATTER.print(createDateTime(timestamp, offset));
        }
    

提交回复
热议问题