Can someone explain difference between ```instant...
# kotlinx-datetime
u
Can someone explain difference between
Copy code
instant.plus(
    value = 30,
    unit = DateTimeUnit.DAY,
    timeZone = currentTimeZone,
)
vs
Copy code
instant.plus(30.days)
Both seem to work, so I'm not sure what's the first one about I mostly want this to compare against a thresholds
j
The first one adds actual days. Try it across a DST change! The second one just adds 30*24*60*60 seconds.
👍 1
u
Uhm I'm reading this but not sure what to pick. Say this is activation threshold, i.e.
Copy code
val gracePeriod = activation.plus(30.days)
is this the correct thing to do or not?
j
It's fine
It means that someone activating at 4pm might time out at 3pm 30 days later if they crossed a DST boundary
u
So this is something a business requirements person should care about, right? And if not, to pick the
duration
variant as a good default?
j
Yeah. I mean if you say 30 days do you mean this time in 30 days, or 30*24hrs
That's the difference
u
Yea Im just imagining the conversation and I'm 93.58% sure they would not know 😀
thank you