Skip to content

Commit fbe8d85

Browse files
authored
Merge pull request #29 from hsfzxjy/hsfzxjy-patch-1
Reorder type params of ConvertTz
2 parents 30c0707 + e7adfae commit fbe8d85

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ func ExampleConvertTz() {
370370
utc := synchro.New[tz.UTC](2009, time.November, 10, 23, 0, 0, 0)
371371
fmt.Printf("Go launched at %s\n", utc)
372372

373-
jst := synchro.ConvertTz[tz.UTC, tz.AsiaTokyo](utc)
373+
jst := synchro.ConvertTz[tz.AsiaTokyo](utc)
374374
fmt.Printf("Go launched at %s\n", jst)
375375
// Output:
376376
// Go launched at 2009-11-10 23:00:00 +0000 UTC

synchro.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,6 @@ func After[T TimeZone](d time.Duration) <-chan Time[T] {
163163
//
164164
// For example to convert from UTC to Asia/Tokyo.
165165
// If `2009-11-10 23:00:00 +0000 UTC` as input, the output will be `2009-11-11 08:00:00 +0900 Asia/Tokyo`.
166-
func ConvertTz[T TimeZone, U TimeZone](from Time[T]) Time[U] {
166+
func ConvertTz[U TimeZone, T TimeZone](from Time[T]) Time[U] {
167167
return In[U](from.tm)
168168
}

0 commit comments

Comments
 (0)