What is the difference between the "withZone ()" and "toDateTime ()" methods of joda DateTime

What is the difference between these two DateTime methods?

DateTime.withZone (DateTimeZone zone)

DateTime.toDateTime (DateTimeZone zone)

??

They both load the time zone without touching the DateTime millisecond.

+4
source share
1 answer

I believe that they are identical. In any case, they perform the same function. It seems that they are implemented separately, instead of calling each other. I'm not sure why.

The only difference that I see is that it toDateTimeneeds to be implemented, because it is defined in AbstractInstant, and DateTimeextends AbstractInstant.

+2

All Articles