]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/news.go
Simplify news article timestamping
[rbdr/mobius] / hotline / news.go
index 7a5c30c784338fb82680d4ca2002f7542067f7c2..a6b8372795c7ff1917f0d0bb3a7593076cbe04ad 100644 (file)
@@ -5,7 +5,6 @@ import (
        "crypto/rand"
        "encoding/binary"
        "sort"
-       "time"
 )
 
 type ThreadedNews struct {
@@ -250,25 +249,3 @@ func (s *Server) GetNewsCatByPath(paths []string) map[string]NewsCategoryListDat
        }
        return cats
 }
-
-// News article date field contains this structure:
-// Year                                        2
-// Milliseconds        2 (seriously?)
-// Seconds                     4
-func NewsDate() []byte {
-       t := time.Now()
-       ms := []byte{0, 0}
-       seconds := []byte{0, 0, 0, 0}
-
-       year := []byte{0, 0}
-       binary.BigEndian.PutUint16(year, uint16(t.Year()))
-
-       yearStart := time.Date(t.Year(), time.January, 1, 0, 0, 0, 0, time.Local)
-
-       binary.BigEndian.PutUint32(seconds, uint32(t.Sub(yearStart).Seconds()))
-
-       date := append(year, ms...)
-       date = append(date, seconds...)
-
-       return date
-}