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()) } 

http://play.golang.org/p/cprxzyfnta


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -