mirror of
https://github.com/idanoo/go-mastodon-stats
synced 2025-07-01 13:52:20 +00:00
20 lines
378 B
Go
20 lines
378 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
localTime, err := time.LoadLocation("Pacific/Auckland")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
// Iterate until Monday!
|
|
t := time.Now().In(localTime)
|
|
for t.Weekday() != time.Monday {
|
|
t = t.AddDate(0, 0, -1)
|
|
}
|
|
year, month, day := t.Date()
|
|
log.Println(time.Date(year, month, day, 0, 0, 0, 0, t.Location()).String())
|
|
}
|