public DateMidnight withZoneRetainFields ( DateTimeZone newZone ) { newZone = DateTimeUtils . getZone ( newZone ) ; DateTimeZone originalZone = DateTimeUtils . getZone ( getZone ( ) ) ; if ( newZone == originalZone ) { return this ; } long millis = originalZone . getMillisKeepLocal ( newZone , getMillis ( ) ) ; return new DateMidnight ( millis , getChronology ( ) . withZone ( newZone ) ) ; }
Returns a copy of this date with a different time zone preserving the day The returned object will have a local time of midnight in the new zone on the same day as the original instant .