go - How to cluster utc in milliseconds to months which belongs -
every document in mongo has timestamp in milliseconds , array of documents result of query. how cluster data array of arrays inner array documents belongs same month ? ( have to weeks, week starts @ monday , last day sunday).
you can month , weekday time package:
package main import "fmt" import "time" func main() { ms := int64(0) t := time.unix(0, ms*int64(time.millisecond)) fmt.println(t.month(), t.weekday()) }
Comments
Post a Comment