Exemplo n.º 1
0
Arquivo: app.go Projeto: jinzhe/GOSNS
func (v *View) FormatTime_2(bid bson.ObjectId) string {
	now := time.Now()
	t := bid.Time()
	duration := now.Sub(t)
	if duration.Hours() < 24 {
		return t.Format("15:04")
	}
	return t.Format("01-02")
}
Exemplo n.º 2
0
Arquivo: app.go Projeto: jinzhe/GOSNS
func (g *View) FormatTime(bid bson.ObjectId) string {
	return bid.Time().Format("2006-01-02 15:04")
}