Convert to CST Using Joda API

后端 未结 3 1995
日久生厌
日久生厌 2021-01-21 07:57

Any one know how to convert UTC time to CST time using joda date time api ? My code is something like this.

DateTimeZone          


        
相关标签:
3条回答
  • 2021-01-21 08:09

    Some of the three-letter time zones (EST and MST, for example) are included in the default time zone database used by Joda. Others (CST and PST, for example) are not. (See http://joda-time.sourceforge.net/timezones.html for more details.)

    The time zone IDs supported by Joda can be obtained by calling org.joda.time.DateTimeZone.getAvailableIDs(), and that set does differ from those returned by java.util.TimeZone.getAvailableIDs().

    0 讨论(0)
  • 2021-01-21 08:11

    You can use "CST6CDT" format of joda time.

    0 讨论(0)
  • 2021-01-21 08:31

    Short time-zone ids like "CST" are unclear and ambiguous, so they are not supported. Use a longer form, like "America/New_York".

    0 讨论(0)
提交回复
热议问题