Skip to content

replace 2-nd "minutes" with "seconds" in date formats #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/controllers/Content/focus.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (c Focus) Add(focus *models.Focus) revel.Result {
rand_num := rand.Intn(99999)

//原图
new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename)
new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename)

//保存文件
old_img := save_path + new_file_name
Expand All @@ -171,7 +171,7 @@ func (c Focus) Add(focus *models.Focus) revel.Result {
return c.Redirect("/Message/")
}

thumb_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_thumb" + path.Ext(header.Filename)
thumb_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_thumb" + path.Ext(header.Filename)

//内容显示图片
web_url_img := web_save_path + thumb_name
Expand Down Expand Up @@ -378,7 +378,7 @@ func (c Focus) Edit(focus *models.Focus) revel.Result {
rand_num := rand.Intn(99999)

//原图
new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename)
new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename)

//保存文件
old_img := save_path + new_file_name
Expand All @@ -391,7 +391,7 @@ func (c Focus) Edit(focus *models.Focus) revel.Result {
return c.Redirect("/Message/")
}

thumb_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_thumb" + path.Ext(header.Filename)
thumb_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_thumb" + path.Ext(header.Filename)

//内容显示图片
web_url_img := web_save_path + thumb_name
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/Extend/copyfrom.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (c Copyfrom) Add(copyfrom *models.Copyfrom) revel.Result {
//新文件名
rand.Seed(time.Now().UnixNano())
rand_num := rand.Intn(99999)
new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename)
new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename)

//创建目录
error := os.MkdirAll(save_path, os.ModePerm)
Expand Down Expand Up @@ -287,7 +287,7 @@ func (c Copyfrom) Edit(copyfrom *models.Copyfrom) revel.Result {
//新文件名
rand.Seed(time.Now().UnixNano())
rand_num := rand.Intn(99999)
new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename)
new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename)

//创建目录
error := os.MkdirAll(save_path, os.ModePerm)
Expand Down
18 changes: 9 additions & 9 deletions app/controllers/Public/kindeditor.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (c *Kindeditor) TitleImage(upload *models.Upload) revel.Result {
rand_num := rand.Intn(99999)

//原图
new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename)
new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename)

//保存文件
old_img := save_path + new_file_name
Expand All @@ -181,7 +181,7 @@ func (c *Kindeditor) TitleImage(upload *models.Upload) revel.Result {
//*******************图片处理****************

//缩略图400
thumb_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_100" + path.Ext(header.Filename)
thumb_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_100" + path.Ext(header.Filename)

//内容显示图片
web_url := web_save_path + thumb_name
Expand Down Expand Up @@ -275,7 +275,7 @@ func (c *Kindeditor) Upload(upload *models.Upload) revel.Result {
rand_num := rand.Intn(99999)

//原图
new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename)
new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename)

//保存文件
old_img := save_path + new_file_name
Expand All @@ -292,7 +292,7 @@ func (c *Kindeditor) Upload(upload *models.Upload) revel.Result {
//*******************图片处理****************

//缩略图400
new_img_thumb_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_400" + path.Ext(header.Filename)
new_img_thumb_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_400" + path.Ext(header.Filename)

//内容显示图片
web_url := web_save_path + new_img_thumb_name
Expand All @@ -302,17 +302,17 @@ func (c *Kindeditor) Upload(upload *models.Upload) revel.Result {
utils.Resize(old_img, new_img_400, "400", "center", "white")

//圆角图片生成
new_img_thumb_0x4 := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_0x4" + path.Ext(header.Filename)
new_img_thumb_0x4 := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_0x4" + path.Ext(header.Filename)
new_img_0x4 := save_path + new_img_thumb_0x4
utils.Vignette(new_img_400, new_img_0x4, "0x4")

//图片反色处理
new_img_thumb_negate := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_negate" + path.Ext(header.Filename)
new_img_thumb_negate := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_negate" + path.Ext(header.Filename)
new_img_negate := save_path + new_img_thumb_negate
utils.Negate(new_img_400, new_img_negate)

//图片加水印之文字水印处理
new_img_watermark := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_watermark" + path.Ext(header.Filename)
new_img_watermark := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_watermark" + path.Ext(header.Filename)
new_img_watermark_file := save_path + new_img_watermark
utils.WatermarkText(new_img_400, new_img_watermark_file)

Expand Down Expand Up @@ -401,7 +401,7 @@ func (c *Kindeditor) AnnounceImage(upload *models.Upload) revel.Result {
rand_num := rand.Intn(99999)

//原图
new_file_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + path.Ext(header.Filename)
new_file_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + path.Ext(header.Filename)

//保存文件
old_img := save_path + new_file_name
Expand All @@ -418,7 +418,7 @@ func (c *Kindeditor) AnnounceImage(upload *models.Upload) revel.Result {
//*******************图片处理****************

//缩略图400
thumb_name := time.Now().Format("20060102150404") + strconv.Itoa(rand_num) + "_400" + path.Ext(header.Filename)
thumb_name := time.Now().Format("20060102150405") + strconv.Itoa(rand_num) + "_400" + path.Ext(header.Filename)

//内容显示图片
web_url := web_save_path + thumb_name
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/User/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (c *User) Add(user *models.User) revel.Result {

} else {
user.Vip = 0
user.Overduedate = time.Now().Format("2006-01-02 15:04:04")
user.Overduedate = time.Now().Format("2006-01-02 15:04:05")
}

if ip := c.Request.Header.Get("X-Forwarded-For"); ip != "" {
Expand Down
4 changes: 2 additions & 2 deletions app/models/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (a *Admin) Save() bool {
admin.Lang = a.Lang
admin.Lastlogintime = "0000-00-00 00:00:00"
admin.Status = a.Status
admin.Createtime = time.Now().Format("2006-01-02 15:04:04")
admin.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Insert(admin)
if err != nil {
Expand All @@ -259,7 +259,7 @@ func (a *Admin) UpdateLoginTime(Id int64) bool {
admin := new(Admin)

admin.Lastloginip = a.Lastloginip
admin.Lastlogintime = time.Now().Format("2006-01-02 15:04:04")
admin.Lastlogintime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Id(Id).Cols("lastloginip", "lastlogintime").Update(admin)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/models/admin_panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (a *Admin_Panel) AddPanel(Mid int64, Admin_Info *Admin) bool {

admin_panel.Name = menu_info.Name
admin_panel.Url = menu_info.Url
admin_panel.Createtime = time.Now().Format("2006-01-02 15:04:04")
admin_panel.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Table("admin_panel").Insert(admin_panel)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/models/announce.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (a *Announce) Save() bool {
announce.Endtime = a.Endtime
announce.Hits = 0
announce.Status = a.Status
announce.Createtime = time.Now().Format("2006-01-02 15:04:04")
announce.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Insert(announce)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions app/models/article.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func (a *Article) Save() bool {
article.Status = a.Status
article.Hits = 0
article.Iscomment = a.Iscomment
article.Createtime = time.Now().Format("2006-01-02 15:04:04")
article.Createtime = time.Now().Format("2006-01-02 15:04:05")
article.Updatetime = "0000-00-00 00:00:00"

has, err := DB_Write.Insert(article)
Expand Down Expand Up @@ -339,7 +339,7 @@ func (a *Article) Edit(Id int64) bool {
article.Istop = a.Istop
article.Status = a.Status
article.Iscomment = a.Iscomment
article.Updatetime = time.Now().Format("2006-01-02 15:04:04")
article.Updatetime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Id(Id).Cols("title", "color", "font", "thumb", "content", "copyfrom", "keywords", "description", "relation", "pagetype", "Maxcharperpage", "istop", "status", "iscomment", "updatetime").Update(article)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/models/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (c *Comment) Save() bool {
comment.Agree = 0
comment.Against = 0
comment.Ip = c.Ip
comment.Createtime = time.Now().Format("2006-01-02 15:04:04")
comment.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Table("comment").Insert(comment)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/models/copyfrom.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (c *Copyfrom) Save() bool {
copyfrom.Sitename = c.Sitename
copyfrom.Siteurl = c.Siteurl
copyfrom.Thumb = c.Thumb
copyfrom.Createtime = time.Now().Format("2006-01-02 15:04:04")
copyfrom.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Insert(copyfrom)
if err != nil {
Expand Down
14 changes: 7 additions & 7 deletions app/models/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ type FiveMinutes struct {
}

func (c FiveMinutes) Run() {
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04"))
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05"))
}

//每三十分钟执行
type ThirtyMinutes struct {
}

func (c ThirtyMinutes) Run() {
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04"))
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05"))
}

//每小时执行
type HourlyMinutes struct {
}

func (c HourlyMinutes) Run() {
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04"))
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05"))
}

//每天执行
Expand All @@ -55,7 +55,7 @@ type DailyMinutes struct {
}

func (c DailyMinutes) Run() {
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04"))
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05"))
}

//每周执行
Expand All @@ -64,7 +64,7 @@ type WeeklyMinutes struct {
}

func (c WeeklyMinutes) Run() {
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04"))
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05"))
}

//每月执行
Expand All @@ -73,7 +73,7 @@ type MonthlyMinutes struct {
}

func (c MonthlyMinutes) Run() {
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04"))
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05"))
}

//每年执行
Expand All @@ -82,5 +82,5 @@ type YearlyMinutes struct {
}

func (c YearlyMinutes) Run() {
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:04"))
revel.WARN.Println("Cron Time:" + time.Now().Format("2006-01-02 15:04:05"))
}
4 changes: 2 additions & 2 deletions app/models/focus.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (c *Focus) Save() bool {
focus.Clicks = 0
focus.Order = c.Order
focus.Status = 1
focus.Createtime = time.Now().Format("2006-01-02 15:04:04")
focus.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Insert(focus)
if err != nil {
Expand All @@ -191,7 +191,7 @@ func (c *Focus) Edit(Id int64) bool {
focus.Content = c.Content
focus.Order = c.Order
focus.Status = 1
focus.Updatetime = time.Now().Format("2006-01-02 15:04:04")
focus.Updatetime = time.Now().Format("2006-01-02 15:04:05")

if len(c.Img) > 0 {
has, err := DB_Write.Id(Id).Cols("cid", "title", "url", "img", "content", "order", "updatetime").Update(focus)
Expand Down
2 changes: 1 addition & 1 deletion app/models/focuscate.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (c *FocusCate) Save() bool {
focuscate.Name = c.Name
focuscate.Width = c.Width
focuscate.Height = c.Height
focuscate.Createtime = time.Now().Format("2006-01-02 15:04:04")
focuscate.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Insert(focuscate)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/models/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (L *Logs) Save(Admin_Info *Admin, c *revel.Controller, Desc string) bool {
}

logs.Desc = Desc
logs.Createtime = time.Now().Format("2006-01-02 15:04:04")
logs.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Insert(logs)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/models/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (r *Role) Save() bool {
role.Desc = r.Desc
role.Data = r.Data
role.Status = r.Status
role.Createtime = time.Now().Format("2006-01-02 15:04:04")
role.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Insert(role)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/models/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (t *Template) Save() bool {
template.Author = t.Author
template.Version = t.Version
template.Status = t.Status
template.Createtime = time.Now().Format("2006-01-02 15:04:04")
template.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Table("template").Insert(template)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/models/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (c *Test) Save() bool {

test := new(Test)
test.Content = "测试"
test.Createtime = time.Now().Format("2006-01-02 15:04:04")
test.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Insert(test)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions app/models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ func (u *User) Save() bool {
user.Mobile = u.Mobile
user.Birthday = u.Birthday
user.Regip = u.Regip
user.Regdate = time.Now().Format("2006-01-02 15:04:04")
user.Lastdate = time.Now().Format("2006-01-02 15:04:04")
user.Regdate = time.Now().Format("2006-01-02 15:04:05")
user.Lastdate = time.Now().Format("2006-01-02 15:04:05")
user.Lastip = u.Lastip
user.Loginnum = 0
user.Groupid = u.Groupid
Expand All @@ -202,7 +202,7 @@ func (u *User) Save() bool {
user.Vip = u.Vip
user.Overduedate = u.Overduedate
user.Status = u.Status
user.Createtime = time.Now().Format("2006-01-02 15:04:04")
user.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Table("user").Insert(user)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/models/user_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (u *User_Group) Save() bool {
user_group.Usernamecolor = u.Usernamecolor
user_group.Desc = u.Desc
user_group.Status = u.Status
user_group.Createtime = time.Now().Format("2006-01-02 15:04:04")
user_group.Createtime = time.Now().Format("2006-01-02 15:04:05")

has, err := DB_Write.Table("user_group").Insert(user_group)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions tests/apptest.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type AppTest struct {
}

func (t *AppTest) Before() {
println("Start time:" + time.Now().Format("2006-01-02 15:04:04"))
println("Start time:" + time.Now().Format("2006-01-02 15:04:05"))
}

func (t AppTest) TestThatIndexPageWorks() {
Expand All @@ -18,5 +18,5 @@ func (t AppTest) TestThatIndexPageWorks() {
}

func (t *AppTest) After() {
println("End time:" + time.Now().Format("2006-01-02 15:04:04"))
println("End time:" + time.Now().Format("2006-01-02 15:04:05"))
}