Two helper families
Each of twelve named locations supports both HH:mm clock conversion and complete date-time conversion.
Fixed-offset Asian time conversion for Go
Convert fixed-offset Asian local times and complete date-times to UTC with a small, dependency-free Go API.
go get github.com/chengchuu/asiatz
Use Go 1.19 or later. The package lives at the module root, so the import path matches the go get path.
go get github.com/chengchuu/asiatzimport asiatz "github.com/chengchuu/asiatz"Pass a strict YYYY-MM-DD HH:mm:ss value to a named fixed-offset helper. The result preserves seconds and includes the correct UTC calendar date after day, month, or year rollover.
utcDateTime, err := asiatz.ShanghaiDateTimeToUTC("2026-01-01 01:01:01")
if err != nil {
log.Fatal(err)
}
fmt.Println(utcDateTime) // 2025-12-31 17:01:01Focused fixed-offset clock and date-time conversion without runtime dependencies.
Each of twelve named locations supports both HH:mm clock conversion and complete date-time conversion.
Date-time conversions preserve seconds and correctly cross days, months, years, and leap days.
Generic functions accept whole-minute offsets such as 5.5 for UTC+05:30 and 5.75 for UTC+05:45.
AsiaTZ uses documented fixed offsets. It does not apply daylight-saving transitions, historical offset changes, or IANA time-zone rules.
The full reference is generated from exported GoDoc comments, so signatures and documentation stay tied to source.
HH:mm clock value when no date is needed.
Requires Go 1.19 or later and is available under the MIT License.