private Timestamp make_localtime ( ) { int offset = _offset != null ? _offset . intValue ( ) : 0 ; // We use a Copy-Constructor that expects the time parameters to be in // UTC, as that's what we're supposed to have. // As this Copy-Constructor doesn't apply local offset to the time // field values (it assumes that the local offset is already applied to // them), we explicitly apply the local offset to the time field values // after we obtain the new Timestamp instance. Timestamp localtime = new Timestamp ( _precision , _year , _month , _day , _hour , _minute , _second , _fraction , _offset , APPLY_OFFSET_NO ) ; // explicitly apply the local offset to the time field values localtime . apply_offset ( - offset ) ; assert localtime . _offset == _offset ; return localtime ; }
Applies the local offset from UTC to each of the applicable time field values and returns the new Timestamp . In short this makes the Timestamp represent local time .