mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-10-09 07:31:52 +00:00
feat:update template
This commit is contained in:
@@ -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