Ejemplo n.º 1
0
Archivo: app.go Proyecto: 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")
}
Ejemplo n.º 2
0
Archivo: app.go Proyecto: jinzhe/GOSNS
func (g *View) FormatTime(bid bson.ObjectId) string {
	return bid.Time().Format("2006-01-02 15:04")
}