Hello community,
I would like to know if it is possible to calculate a person's age using months and days as a result. For example, Isabela is 25 months and 2 days old.
Short answer is "yes".
But, depends on how the data is collected. E.g.,
Sorry. Only realized as I hit submit what you were asking for.
The answer is still "yes", but that would require a lot more effort.
If you are set on months and days as the output, JS is likely the best approach (example). It is possible in S123, but would involve convoluted calculates.
The example posted is in java, not javascript 😬
Anyway, as you mentioned the possible solution is far more complex than it seems, because of leap years, months not being units of equal measurement in time, and other complexities some folks have outlined before.
Thanks for the feedback. I also have this feeling, due to S123 the complexity of this calculation will be great. I will study this way using VScode. If I get a positive result, I will send it to you. I believe other people have already encountered this situation.