Fixed-offset Asian time conversion for Go

AsiaTZ

Convert fixed-offset Asian local times and complete date-times to UTC with a small, dependency-free Go API.

Install
go get github.com/chengchuu/asiatz

Install 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/asiatz
import asiatz "github.com/chengchuu/asiatz"

Convert a complete date-time to UTC

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.

Open the complete basic example
utcDateTime, err := asiatz.ShanghaiDateTimeToUTC("2026-01-01 01:01:01")
if err != nil {
    log.Fatal(err)
}
fmt.Println(utcDateTime) // 2025-12-31 17:01:01

Verified package capabilities

Focused fixed-offset clock and date-time conversion without runtime dependencies.

Two helper families

Each of twelve named locations supports both HH:mm clock conversion and complete date-time conversion.

Calendar-aware results

Date-time conversions preserve seconds and correctly cross days, months, years, and leap days.

Fractional offsets

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.

API preview

The full reference is generated from exported GoDoc comments, so signatures and documentation stay tied to source.

Requires Go 1.19 or later and is available under the MIT License.