Add ToNano method to convert RFC3339Time to RFC3339NanoTime

This commit is contained in:
2025-11-05 14:45:47 +01:00
parent 535a699584
commit 833f74427f

View File

@@ -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())
}