Page 1 of 1

[HD Pg 348, Sec. 12.3.4 - comparing-date-time-objects]

Posted: Tue Apr 23, 2019 1:00 pm
by OCAJO1
IsZero only returns true if all the three components of the Period are zero.
I think this statement should read different, since I tested it with just P0Y and then just with P0w as well as P0y0m0w0d and all three cases resulted in true.

Re: [HD Pg 348, Sec. 12.3.4 - comparing-date-time-objects]

Posted: Tue Apr 23, 2019 1:05 pm
by admin
1. What do you think will be the values of other components in the string p0y?
2. It is talking about the components of a Period , not about the string used to create a Period. Components of a Period and the string used to create it are two different things.
3.Components of a Period are years, months and days. How you create a Period is immaterial.

Re: [HD Pg 348, Sec. 12.3.4 - comparing-date-time-objects]

Posted: Tue Apr 23, 2019 1:25 pm
by OCAJO1
Oh I see. So when the string to create the Period is missing the year or days, then that component is just set to zero automatically.