Skip to content

Commit

Permalink
Merge pull request #29 from hsfzxjy/hsfzxjy-patch-1
Browse files Browse the repository at this point in the history
Reorder type params of ConvertTz
  • Loading branch information
Code-Hex authored Dec 12, 2023
2 parents 30c0707 + e7adfae commit fbe8d85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func ExampleConvertTz() {
utc := synchro.New[tz.UTC](2009, time.November, 10, 23, 0, 0, 0)
fmt.Printf("Go launched at %s\n", utc)

jst := synchro.ConvertTz[tz.UTC, tz.AsiaTokyo](utc)
jst := synchro.ConvertTz[tz.AsiaTokyo](utc)
fmt.Printf("Go launched at %s\n", jst)
// Output:
// Go launched at 2009-11-10 23:00:00 +0000 UTC
Expand Down
2 changes: 1 addition & 1 deletion synchro.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,6 @@ func After[T TimeZone](d time.Duration) <-chan Time[T] {
//
// For example to convert from UTC to Asia/Tokyo.
// If `2009-11-10 23:00:00 +0000 UTC` as input, the output will be `2009-11-11 08:00:00 +0900 Asia/Tokyo`.
func ConvertTz[T TimeZone, U TimeZone](from Time[T]) Time[U] {
func ConvertTz[U TimeZone, T TimeZone](from Time[T]) Time[U] {
return In[U](from.tm)
}

0 comments on commit fbe8d85

Please sign in to comment.