mirror of
https://github.com/redis/go-redis.git
synced 2025-08-01 16:06:54 +03:00
Marshal time as RFC3339. Add StringCmd.Time helper.
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/go-redis/redis/internal/util"
|
||||
)
|
||||
@ -92,6 +93,8 @@ func (w *Writer) writeArg(v interface{}) error {
|
||||
} else {
|
||||
return w.int(0)
|
||||
}
|
||||
case time.Time:
|
||||
return w.string(v.Format(time.RFC3339))
|
||||
case encoding.BinaryMarshaler:
|
||||
b, err := v.MarshalBinary()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user