2022-01-20 07:46:51 -06:00
|
|
|
package database
|
|
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
|
|
// Now returns a standardized timezone used for database resources.
|
|
|
|
|
func Now() time.Time {
|
2022-09-02 11:42:28 -05:00
|
|
|
return Time(time.Now().UTC())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Time returns a time compatible with Postgres. Postgres only stores dates with
|
|
|
|
|
// microsecond precision.
|
|
|
|
|
func Time(t time.Time) time.Time {
|
|
|
|
|
return t.Round(time.Microsecond)
|
2022-01-20 07:46:51 -06:00
|
|
|
}
|