5 ms·
> If you want to add two days you can't just call Add(0 /years/, 0 /months/, 2 /days/), you need to use AddDate. Sorry for nit-picking, but 2 days is a duratio
by zxvkhkxvdvbdxz 2y ago
> If you want to add two days you can't just call Add(0 /years/, 0 /months/, 2 /days/), you need to use AddDate.
Sorry for nit-picking, but 2 days is a duration of time, and you can add one using Add, like this:
t.Add(time.Hour * 24 * 2)
I agree about FFI being a weak point in go when you need to interact with other languages, but it can hopefully be mitigated by using tinygo, which is still being developed.
- ben0x539 2y agoDoes this do what you want across/during DST switchover?
- deleted 2y ago[deleted]
- theshrike79 2y agoWhat do you want to happen during a DST switchover in this case?
- stouset 2y agoIf I add two days, semantically, I want to add two days. The date should increment by two. The time should remain the same, even if a DST transition has occurred.