Am 26.02.18 um 11:13 schrieb Petr Fischer:
So "date addMonths: 12" behaves better for my needs. Thanks
Hmm. We've had this discussion just the other day at Lunch. What is a month? Should addMonths: 1 and then subtractMonths: 1 on January 31st bring you back to January 31st? How would you implement that?

I guess this is a problem that cannot be solved by a machine without additional context. Does 1 month later mean "on this day next month" or does it mean "exactly as many days in the future as the current month has days"? None of the two? Can one month later be in March when today is January 30th?

It seems years and months are a bit incompatible with informatics ;-) In my opinion, there is more info needed than "x months/years later" in order to calculate the correct result.

Joachim






Hello, just simple test:

(Date year: 2019 month: 2 day: 26) + 1 year.
returns: 26 February 2020
OK

(Date year: 2020 month: 2 day: 26) + 1 year.
returns: 25 February 2021
What?

(maybe I do not understand something  about dates again)

Thanks! pf



--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          mailto:jtuc...@objektfabrik.de
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1


Reply via email to