Calculates the number of years, months, days, hours, minutes, seconds or microseconds between two date(time)s.
Notice:
This function never cross the month boundary when it handles months delta with different numbers of days.
Examples:
1. (2021-08-31 - 2021-09-30) and (2021-08-30 - 2021-09-30) will give the same result, months=+1;
2. (2021-01-28 - 2021-02-28), (2021-01-29 - 2021-02-28), (2021-01-30 - 2021-02-28) and (2021-01-31 - 2021-02-28) will give the same result, months=+1
Scenario Outline: The start date do not involve last day of month (9 examples) |
|
||
Scenario Outline: The start date with 31 as last day (14 examples) |
|
||
Scenario Outline: The start date involve last day of february (9 examples) |
|
||
Scenario Outline: The months with different numbers of days (8 examples) |
|
||
Scenario Outline: The time substraction (10 examples) |
|
Given the first date {start date} and the second date {end date}
When the datedif function is used to compute the difference between them
Then the returned relative delta should be {relative delta}
Examples:
Given the first date {start date} and the second date {end date}
When the datedif function is used to compute the difference between them
Then the returned relative delta should be {relative delta}
Examples:
Given the first date {start date} and the second date {end date}
When the datedif function is used to compute the difference between them
Then the returned relative delta should be {relative delta}
Examples:
Given the first date {start date} and the second date {end date}
When the datedif function is used to compute the difference between them
Then the returned relative delta should be {relative delta}
Given the first date {start date} and the second date {end date}
When the datedif function is used to compute the difference between them
Then the returned relative delta should be {relative delta}
Examples:
Number of Scenarios | 5 | Total Duration | 1s |
Total Number of Test Cases | 50 | Fastest Test | 15ms |
Number of Manual Test Cases | 0 | Slowest Test | 55ms |
Tests Started | Apr 11, 2023 10:42:05 | Average Execution Time | 26ms |
Tests Finished | Apr 11, 2023 10:42:07 | Total Execution Time | 1s |
feature | Scenario | Context | Steps | Started | Total Duration | Result |
---|---|---|---|---|---|---|
DATEDIF Function |
1: The start date do not involve last day of month
start date=2021-09-20, end date=2021-10-20, relative delta=months=1 |
3 | 10:42:05 | 049ms | ||
DATEDIF Function |
2: The start date do not involve last day of month
start date=2021-09-20, end date=2021-10-21, relative delta=months=1, days=1 |
3 | 10:42:06 | 023ms | ||
DATEDIF Function |
3: The start date do not involve last day of month
start date=2021-09-20, end date=2021-08-20, relative delta=months=-1 |
3 | 10:42:06 | 020ms | ||
DATEDIF Function |
4: The start date do not involve last day of month
start date=2021-09-20, end date=2021-11-20, relative delta=months=2 |
3 | 10:42:06 | 032ms | ||
DATEDIF Function |
5: The start date do not involve last day of month
start date=2021-09-20, end date=2021-10-27, relative delta=months=1, days=7 |
3 | 10:42:06 | 024ms | ||
DATEDIF Function |
6: The start date do not involve last day of month
start date=2021-09-20, end date=2022-08-20, relative delta=months=11 |
3 | 10:42:06 | 023ms | ||
DATEDIF Function |
7: The start date do not involve last day of month
start date=2021-09-20, end date=2022-10-20, relative delta=years=1, months=1 |
3 | 10:42:06 | 020ms | ||
DATEDIF Function |
8: The start date do not involve last day of month
start date=2021-09-20, end date=2021-09-30, relative delta=days=10 |
3 | 10:42:06 | 023ms | ||
DATEDIF Function |
9: The start date do not involve last day of month
start date=2021-09-20, end date=2021-10-02, relative delta=days=12 |
3 | 10:42:06 | 023ms | ||
DATEDIF Function |
1: The start date with 31 as last day
start date=2021-01-31, end date=2021-02-28, relative delta=months=1 |
3 | 10:42:06 | 022ms | ||
DATEDIF Function |
2: The start date with 31 as last day
start date=2021-01-30, end date=2021-02-28, relative delta=months=1 |
3 | 10:42:06 | 026ms | ||
DATEDIF Function |
3: The start date with 31 as last day
start date=2021-01-29, end date=2021-02-28, relative delta=months=1 |
3 | 10:42:06 | 029ms | ||
DATEDIF Function |
4: The start date with 31 as last day
start date=2021-01-28, end date=2021-02-28, relative delta=months=1 |
3 | 10:42:06 | 023ms | ||
DATEDIF Function |
5: The start date with 31 as last day
start date=2021-01-27, end date=2021-02-28, relative delta=months=1, days=1 |
3 | 10:42:06 | 027ms | ||
DATEDIF Function |
6: The start date with 31 as last day
start date=2021-01-26, end date=2021-02-28, relative delta=months=1, days=2 |
3 | 10:42:06 | 031ms | ||
DATEDIF Function |
7: The start date with 31 as last day
start date=2021-01-31, end date=2020-12-31, relative delta=months=-1 |
3 | 10:42:06 | 036ms | ||
DATEDIF Function |
8: The start date with 31 as last day
start date=2021-01-31, end date=2021-03-31, relative delta=months=2 |
3 | 10:42:06 | 023ms | ||
DATEDIF Function |
9: The start date with 31 as last day
start date=2021-01-31, end date=2021-04-30, relative delta=months=3 |
3 | 10:42:06 | 031ms | ||
DATEDIF Function |
10: The start date with 31 as last day
start date=2021-01-31, end date=2021-03-07, relative delta=months=1, days=7 |
3 | 10:42:06 | 028ms | ||
DATEDIF Function |
11: The start date with 31 as last day
start date=2021-01-31, end date=2021-12-31, relative delta=months=11 |
3 | 10:42:06 | 027ms | ||
DATEDIF Function |
12: The start date with 31 as last day
start date=2021-01-31, end date=2022-02-28, relative delta=years=1, months=1 |
3 | 10:42:06 | 024ms | ||
DATEDIF Function |
13: The start date with 31 as last day
start date=2021-01-31, end date=2024-02-29, relative delta=years=3, months=1 |
3 | 10:42:06 | 029ms | ||
DATEDIF Function |
14: The start date with 31 as last day
start date=2021-01-31, end date=2021-02-10, relative delta=days=10 |
3 | 10:42:06 | 030ms | ||
DATEDIF Function |
1: The start date involve last day of february
start date=2021-02-28, end date=2021-03-28, relative delta=months=1 |
3 | 10:42:06 | 023ms | ||
DATEDIF Function |
2: The start date involve last day of february
start date=2021-02-28, end date=2021-03-29, relative delta=months=1, days=1 |
3 | 10:42:06 | 025ms | ||
DATEDIF Function |
3: The start date involve last day of february
start date=2021-02-28, end date=2021-03-30, relative delta=months=1, days=2 |
3 | 10:42:06 | 024ms | ||
DATEDIF Function |
4: The start date involve last day of february
start date=2021-02-28, end date=2021-03-31, relative delta=months=1, days=3 |
3 | 10:42:06 | 030ms | ||
DATEDIF Function |
5: The start date involve last day of february
start date=2021-02-28, end date=2021-01-28, relative delta=months=-1 |
3 | 10:42:06 | 034ms | ||
DATEDIF Function |
6: The start date involve last day of february
start date=2021-02-28, end date=2021-04-28, relative delta=months=2 |
3 | 10:42:06 | 035ms | ||
DATEDIF Function |
7: The start date involve last day of february
start date=2021-02-28, end date=2021-05-28, relative delta=months=3 |
3 | 10:42:06 | 039ms | ||
DATEDIF Function |
8: The start date involve last day of february
start date=2021-02-28, end date=2022-02-28, relative delta=years=1 |
3 | 10:42:07 | 031ms | ||
DATEDIF Function |
9: The start date involve last day of february
start date=2021-02-28, end date=2024-02-28, relative delta=years=3 |
3 | 10:42:07 | 029ms | ||
DATEDIF Function |
1: The months with different numbers of days
start date=2021-01-27, end date=2021-02-27, relative delta=months=1 |
3 | 10:42:07 | 030ms | ||
DATEDIF Function |
2: The months with different numbers of days
start date=2021-01-28, end date=2021-02-28, relative delta=months=1 |
3 | 10:42:07 | 033ms | ||
DATEDIF Function |
3: The months with different numbers of days
start date=2021-01-29, end date=2021-02-28, relative delta=months=1 |
3 | 10:42:07 | 035ms | ||
DATEDIF Function |
4: The months with different numbers of days
start date=2021-01-30, end date=2021-02-28, relative delta=months=1 |
3 | 10:42:07 | 032ms | ||
DATEDIF Function |
5: The months with different numbers of days
start date=2021-01-31, end date=2021-02-28, relative delta=months=1 |
3 | 10:42:07 | 055ms | ||
DATEDIF Function |
6: The months with different numbers of days
start date=2021-01-31, end date=2021-03-31, relative delta=months=2 |
3 | 10:42:07 | 030ms | ||
DATEDIF Function |
7: The months with different numbers of days
start date=2021-01-31, end date=2021-04-30, relative delta=months=3 |
3 | 10:42:07 | 021ms | ||
DATEDIF Function |
8: The months with different numbers of days
start date=2021-01-30, end date=2021-04-30, relative delta=months=3 |
3 | 10:42:07 | 018ms | ||
DATEDIF Function |
1: The time substraction
start date=2021-10-20T16:10:59, end date=2021-10-20T17:10:59, relative delta=hours=1 |
3 | 10:42:07 | 018ms | ||
DATEDIF Function |
2: The time substraction
start date=2021-10-20T16:10:59, end date=2021-10-20T15:10:59, relative delta=hours=-1 |
3 | 10:42:07 | 018ms | ||
DATEDIF Function |
3: The time substraction
start date=2021-10-20T16:10:59, end date=2021-10-21T02:10:59, relative delta=hours=10 |
3 | 10:42:07 | 017ms | ||
DATEDIF Function |
4: The time substraction
start date=2021-10-20T16:10:59, end date=2021-10-21T16:10:59, relative delta=days=1 |
3 | 10:42:07 | 023ms | ||
DATEDIF Function |
5: The time substraction
start date=2021-10-20T16:10:59, end date=2021-10-20T17:20:59, relative delta=hours=1, minutes=10 |
3 | 10:42:07 | 031ms | ||
DATEDIF Function |
6: The time substraction
start date=2021-10-20T16:10:59, end date=2021-10-20T17:10:59, relative delta=hours=1 |
3 | 10:42:07 | 015ms | ||
DATEDIF Function |
7: The time substraction
start date=2021-10-20T16:10:59, end date=2021-10-20T16:11:00, relative delta=seconds=1 |
3 | 10:42:07 | 018ms | ||
DATEDIF Function |
8: The time substraction
start date=2021-10-20T16:10:59, end date=2021-10-21T17:10:59, relative delta=days=1, hours=1 |
3 | 10:42:07 | 016ms | ||
DATEDIF Function |
9: The time substraction
start date=2021-10-20T16:10:59, end date=2021-11-21T17:10:59, relative delta=months=1, days=1, hours=1 |
3 | 10:42:07 | 016ms | ||
DATEDIF Function |
10: The time substraction
start date=2021-01-31T16:10:59, end date=2021-03-01T17:10:59, relative delta=months=1, days=1, hours=1 |
3 | 10:42:07 | 020ms |