Back to Lo

Core Latest

docs/data/core-latest.md

1.53.0270 B
Original Source

Searches the maximum time.Time in the provided arguments. Returns zero value when the input is empty.

go
t1 := time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC)
t2 := time.Date(2024, 1, 1, 0, 0, 0, 0, time.UTC)
max := lo.Latest(t1, t2)
// 2024-01-01 00:00:00 +0000 UTC