mirror of
https://github.com/idanoo/go-mastodon-stats
synced 2025-07-01 22:02:20 +00:00
Log
This commit is contained in:
parent
43514cc0b0
commit
adfcf44890
3 changed files with 36 additions and 10 deletions
20
test.go
Normal file
20
test.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
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())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue