MakeDTimestamp creates a DTimestamp with specified precision.
(t time.Time, precision time.Duration)
| 2606 | |
| 2607 | // MakeDTimestamp creates a DTimestamp with specified precision. |
| 2608 | func MakeDTimestamp(t time.Time, precision time.Duration) (_ *DTimestamp, err error) { |
| 2609 | if t, err = roundAndCheck(t, precision); err != nil { |
| 2610 | return nil, err |
| 2611 | } |
| 2612 | return &DTimestamp{Time: t}, nil |
| 2613 | } |
| 2614 | |
| 2615 | // MustMakeDTimestamp wraps MakeDTimestamp but panics if there is an error. |
| 2616 | // This is intended for testing applications only. |
no test coverage detected
searching dependent graphs…