Time returns a time compatible with Postgres. Postgres only stores dates with microsecond precision. FIXME(dannyk): refactor all calls to Time() to expect the input time to be modified to UTC; there are currently a few calls whose behavior would change subtly. See https://github.com/coder/coder/p
(t time.Time)
| 14 | // few calls whose behavior would change subtly. |
| 15 | // See https://github.com/coder/coder/pull/14274#discussion_r1718427461 |
| 16 | func Time(t time.Time) time.Time { |
| 17 | return t.Round(time.Microsecond) |
| 18 | } |
| 19 | |
| 20 | // StartOfDay returns the first timestamp of the day of the input timestamp in its location. |
| 21 | func StartOfDay(t time.Time) time.Time { |
no outgoing calls