Add ToNano method to convert RFC3339Time to RFC3339NanoTime
This commit is contained in:
@@ -4,13 +4,14 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"reflect"
|
||||||
|
"time"
|
||||||
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsontype"
|
"go.mongodb.org/mongo-driver/bson/bsontype"
|
||||||
"reflect"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type RFC3339Time time.Time
|
type RFC3339Time time.Time
|
||||||
@@ -263,3 +264,7 @@ func NewRFC3339Ptr(t *time.Time) *RFC3339Time {
|
|||||||
func NowRFC3339() RFC3339Time {
|
func NowRFC3339() RFC3339Time {
|
||||||
return RFC3339Time(time.Now())
|
return RFC3339Time(time.Now())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t RFC3339Time) ToNano() RFC3339NanoTime {
|
||||||
|
return NewRFC3339Nano(t.Time())
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user