In joda time how to convert time zone without changing time

后端 未结 7 2009
一生所求
一生所求 2020-12-04 19:06

I am getting UTC timestamp from database which is I am setting into a JodaTime DateTime instance

DateTime dt = new DateTime(timestamp.getTime())         


        
7条回答
  •  孤街浪徒
    2020-12-04 19:31

    I had the same problem. After reading this set of useful answers, and given my particular needs and available objects, I solved it by using another DateTime constructor:

    new DateTime("2012-04-23T18:25:46.511Z", DateTimeZone.UTC)
    

提交回复
热议问题