Test suit for dates
These are a series of date for my counttime() function to be tested againsttime span | correct answer | status | response from function |
2007-04-25 -> 2008-03-26 Time span over leap year |
11 months and 1 day | 11 månader och 1 dag | |
2007-04-25 15:00 -> 2008-03-26 17:00 leap year and daylight savings time |
11 months, 1 day and 2 hours | 11 månader, 1 dag och 2 timmar | |
2003-02-28 -> 2005-02-28 Also leap years |
2 years | 2 år | |
1998-01-31 -> 2008-01-30 one year minus one day |
9 years, 11 months and 30 days | 9 år, 11 månader och 30 dagar | |
2008-02-01 -> 2008-03-15 14 days in spite of leap year (so it's actually 15 days) |
1 month and 14 days | 1 månad och 14 dagar | |
2007-02-01 -> 2007-03-15 Same as above when there is no leap year |
1 month and 14 days | 1 månad och 14 dagar | |
2008-02-17 -> 2008-03-15 27 days on account of the leap year |
27 days | 27 dagar | |
2007-02-17 -> 2007-03-15 26 days since there is no leap year |
26 days | 26 dagar | |
2008-02-29 -> 2009-02-28 One year since 29 feb doesn't exist in 2009 |
1 year | 1 år | |
2008-02-28 -> 2009-02-28 Also a year |
1 year | 1 år | |
2008-02-29 -> 2008-03-29 | 1 month | 1 månad | |
2007-02-28 -> 2007-03-29 When the day differs, days are counted as well. |
1 month and 1 day | 1 månad och 1 dag |
Note that the function responds correctly to, for example, 1550-01-01 -> 1950-01-01, but it takes a while for AdoDB to calculate it so I've removed it from the test suite.