Timezones

Report a typo

For a given date, print its value in the most popular timezones:

  • London (UTC+1.00)
  • Moscow (UTC+3.00)
  • New York (UTC-4.00)
  • Hong Kong (UTC+8.00)
  • Tokyo (UTC+9.00)
  • Darwin (UTC+9.30)

Sample Input 1:

Sample Output 1:

London: 1902-11-02 01:00:00 +0000 UTC
Moscow: 1902-11-02 03:00:00 +0000 UTC
New York: 1902-11-01 20:00:00 +0000 UTC
Hong Kong: 1902-11-02 08:00:00 +0000 UTC
Tokyo: 1902-11-02 09:00:00 +0000 UTC
Darwin: 1902-11-02 09:30:00 +0000 UTC
Write a program in Go
package main

import (
"fmt"
"time"
)

const (
Year = 1902
Month = 11
Day = 2
)

// DO NOT delete the comments on each line below!
func main() {
utc := time.Date(Year, Month, Day, 0, 0, 0, 0, time.UTC)
london := utc.Add(1 * time.Hour) // nolint: gomnd
moscow := utc.Add(? * time.Hour) // nolint: gomnd
newYork := utc.Add(-4 * ?) // nolint: gomnd
hongKong := utc.Add(?) // nolint: gomnd
tokyo := utc.Add(?) // nolint: gomnd
darwin := utc.Add(? + ?*time.Minute) // nolint: gomnd

fmt.Printf("London: %v\n", London)
//Repeat for:
//Moscow
//New York
//Hong Kong
//Tokyo
//Darwin
}
___

Create a free account to access the full topic