LoginSignup
1
1

More than 3 years have passed since last update.

Debug timezone in Docker

Last updated at Posted at 2019-10-08
  • Code
package main

import (
        "fmt"
        "github.com/uniplaces/carbon"
)

func main() {
        loc := "Asia/Tokyo"
        now, _ := carbon.NowInLocation(loc)
        today := now.StartOfDay()
        tomorrow := today.AddDay()
        fmt.Println(now, today, tomorrow)
}
$ docker run --rm -it --privileged -v $(pwd):/app golang bash

$ cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

$ date +%T -s "07:00:00"

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1