Hacker News new | ask | show | jobs
by zxvkhkxvdvbdxz 511 days 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.
1 comments

Does this do what you want across/during DST switchover?
What do you want to happen during a DST switchover in this case?
If 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.