Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
time: time.Local doesn't match the timezone reported from Java on android #10857
Java and Go should have matching default timezones.
log.Println("local: ", time.Local)
Log.i(TAG, "java timezone: " + java.util.TimeZone.getDefault());
java timezone: libcore.util.ZoneInfo[id="Pacific/Midway",mRawOffset=-39600000,mEarliestRawOffset=-39600000,mUseDst=false,mDstSavings=3600000,transitions=4]
@hyangah you may also have a zoneinfo problem, but the problem with time.Local is most likely different. If the TZ environment variable is not set, the time package loads /etc/localtime. On conventional Unix systems that is a copy of the zoneinfo data for the local timezone. On Android that file may be somewhere else, or it may not exist.
See initLocal in time/zoneinfo_unix.go.