feat:update template
This commit is contained in:
1 parent
485110f214
commit
caab6097b8
2 files changed
+12
-5
No files matched your search
@@ -29,6 +29,12 @@ func GetCurrentTime() time.Time {
|
||||
return time.Now()
|
||||
}
|
||||
|
||||
func FormatTimeStr(timeStr string) (string, error) {
|
||||
loc, _ := time.LoadLocation("Local")
|
||||
theTime, err := time.ParseInLocation("2006-01-02T15:04:05.000Z", timeStr, loc)
|
||||
return theTime.Format("2006/01/02 15:04:05"), err
|
||||
}
|
||||
|
||||
func StructToJsonStr(e interface{}) (string, error) {
|
||||
if b, err := json.Marshal(e); err == nil {
|
||||
return string(b), err
|
||||
|
||||
Reference in new issue
Block a user