kataras / kataras/iris

How to set the default time format for serialization of MVC response objects?

Open
#2,454 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
25.6k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

How should I set up MVC What is the format of the date and time when serializing objects in Response?
`
func (this *BussApiController) GetActivityBySearch() mvc.Result {

ActivityList,total := loadFromDB(...)
return mvc.Response{
Object: iris.Map{"success": success, "message": message, "activityList": ActivityList, "total": total},
}
}
`
I used to be able to set the default time format for JSON serialization using the GitHub. com/liamylian/jsontime/v2/v2 package when using v12.2.8. However, after upgrading to v12.2.11, this method has become ineffective.

`import(

...
jsonTime "github.com/liamylian/jsontime/v2/v2"
)
func main() {

jsonTime.SetDefaultTimeFormat("2006-01-02 15:04:05", time.Local)
...
}
`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.