chore(repo): reinitialize repository

This commit is contained in:
2026-03-18 11:29:54 +08:00
commit 24871e213a
288 changed files with 44369 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
package timeutil
import "time"
type Clock interface {
Now() time.Time
}
type SystemClock struct{}
func (SystemClock) Now() time.Time {
return time.Now().UTC()
}
type FixedClock struct {
Time time.Time
}
func (c FixedClock) Now() time.Time {
return c.Time.UTC()
}
func NowUTC() time.Time {
return time.Now().UTC()
}
func FormatRFC3339(t time.Time) string {
return t.UTC().Format(time.RFC3339)
}
func FormatRFC3339Nano(t time.Time) string {
return t.UTC().Format(time.RFC3339Nano)
}
func TimestampIDPart(t time.Time) string {
return t.UTC().Format("20060102T150405Z")
}