AddTimeZone uses the supplied location to convert this Timestamp to a timestamp with a timezone. It is the inverse of EvalAtAndRemoveTimeZone.
( loc *time.Location, precision time.Duration, )
| 3101 | // AddTimeZone uses the supplied location to convert this Timestamp to a |
| 3102 | // timestamp with a timezone. It is the inverse of EvalAtAndRemoveTimeZone. |
| 3103 | func (d *DTimestamp) AddTimeZone( |
| 3104 | loc *time.Location, precision time.Duration, |
| 3105 | ) (*DTimestampTZ, error) { |
| 3106 | // Treat the Timestamp as if it were already shifted by the location offset, |
| 3107 | // and shift by the negative offset to convert it to UTC. |
| 3108 | _, locOffset := d.Time.In(loc).Zone() |
| 3109 | t := d.Time.Add(time.Duration(-locOffset) * time.Second) |
| 3110 | return MakeDTimestampTZ(t.UTC(), precision) |
| 3111 | } |
| 3112 | |
| 3113 | // DInterval is the interval Datum. |
| 3114 | type DInterval struct { |
nothing calls this directly
no test coverage detected