MakeDTimestampTZFromDate creates a DTimestampTZ from a DDate. This will be equivalent to the midnight of the given zone.
(loc *time.Location, d *DDate)
| 2354 | // MakeDTimestampTZFromDate creates a DTimestampTZ from a DDate. |
| 2355 | // This will be equivalent to the midnight of the given zone. |
| 2356 | func MakeDTimestampTZFromDate(loc *time.Location, d *DDate) (*DTimestampTZ, error) { |
| 2357 | t, err := d.ToTime() |
| 2358 | if err != nil { |
| 2359 | return nil, err |
| 2360 | } |
| 2361 | // Normalize to the correct zone. |
| 2362 | t = t.In(loc) |
| 2363 | _, offset := t.Zone() |
| 2364 | return MakeDTimestampTZ(t.Add(time.Duration(-offset)*time.Second), time.Microsecond), nil |
| 2365 | } |
| 2366 | |
| 2367 | // ParseDTimestampTZ parses and returns the *DTimestampTZ Datum value represented by |
| 2368 | // the provided string in the provided location, or an error if parsing is unsuccessful. |
no test coverage detected
searching dependent graphs…