Sub returns a [time.Duration] by subtracting the specified DateTime from the current one. If the result exceeds the maximum (or minimum) value that can be stored in a [time.Duration], the maximum (or minimum) duration will be returned.
(u DateTime)
| 46 | // If the result exceeds the maximum (or minimum) value that can be stored in a [time.Duration], |
| 47 | // the maximum (or minimum) duration will be returned. |
| 48 | func (d DateTime) Sub(u DateTime) time.Duration { |
| 49 | return d.Time().Sub(u.Time()) |
| 50 | } |
| 51 | |
| 52 | // AddDate returns a new DateTime based on the current one + duration. |
| 53 | // |