v2_10
This commit is contained in:
@@ -3,6 +3,7 @@ package convertor
|
||||
import (
|
||||
"net/url"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
func ConvertInt[T int | int16 | int32 | int64](value string, defaultValue T) T {
|
||||
@@ -35,3 +36,13 @@ func QueryInt[T int | int16 | int32 | int64](vars url.Values, key string, defaul
|
||||
|
||||
return T(i)
|
||||
}
|
||||
|
||||
func DefaultStartTimeAndEndTime(start string, end string) (string, string) {
|
||||
if len(start) == 0 {
|
||||
start = "2000-01-01 00:00:00"
|
||||
}
|
||||
if len(end) == 0 {
|
||||
end = time.Now().Add(time.Hour * 24).Format(time.DateTime)
|
||||
}
|
||||
return start, end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user