From 833f74427fb159436738d03e1f8b324a11f14bfc Mon Sep 17 00:00:00 2001 From: Christopher Reiter Date: Wed, 5 Nov 2025 14:45:47 +0100 Subject: [PATCH] Add `ToNano` method to convert `RFC3339Time` to `RFC3339NanoTime` --- rfctime/rfc3339.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rfctime/rfc3339.go b/rfctime/rfc3339.go index 73934f0..21d95a3 100644 --- a/rfctime/rfc3339.go +++ b/rfctime/rfc3339.go @@ -4,13 +4,14 @@ import ( "encoding/json" "errors" "fmt" + "reflect" + "time" + "git.blackforestbytes.com/BlackForestBytes/goext/langext" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/bsoncodec" "go.mongodb.org/mongo-driver/bson/bsonrw" "go.mongodb.org/mongo-driver/bson/bsontype" - "reflect" - "time" ) type RFC3339Time time.Time @@ -263,3 +264,7 @@ func NewRFC3339Ptr(t *time.Time) *RFC3339Time { func NowRFC3339() RFC3339Time { return RFC3339Time(time.Now()) } + +func (t RFC3339Time) ToNano() RFC3339NanoTime { + return NewRFC3339Nano(t.Time()) +}