Here are the keyword arguments
- years, months, weeks, days, hours, minutes, seconds, microseconds:
The integer value to specify may be negative or positive;
- weekday:
This argument allows to shift a date to the specified next or previous Nth weekday.
This argument should be one of the weekday instances (SU, MO, TU, WE, TH, FR, SA). These instances may receive a parameter N, specifying the Nth weekday, which could be positive or negative
(like MO(+1) or MO(-2)). Not specifying it is the same as specifying +1. If the calculated date is already Monday, using MO(1) or MO(-1) won't change the day.
The above arguments are applied in the following order:
years
months
days
hours
minutes
seconds
microseconds
weekday
Notice:
The EDATE and EOMONTH functions are only very special cases of this much more general SDATE function.
Scenario Outline: The start date do not involve last day of month (13 examples) |
|
||
Scenario Outline: The start date with 31 as last day (11 examples) |
|
||
Scenario Outline: The start date involve last day of february (6 examples) |
|
||
Scenario Outline: The months with different numbers of days (7 examples) |
|
||
Scenario Outline: The time addition (10 examples) |
|
Given the date {start date}
When relative delta {relative delta} is applied
Then the relative date should be {relative date}
Examples:
Given the date {start date}
When relative delta {relative delta} is applied
Then the relative date should be {relative date}
Examples:
Given the date {start date}
When relative delta {relative delta} is applied
Then the relative date should be {relative date}
Examples:
Given the date {start date}
When relative delta {relative delta} is applied
Then the relative date should be {relative date}
Examples:
Given the date {start date}
When relative delta {relative delta} is applied
Then the relative date should be {relative date}
Examples:
Number of Scenarios | 5 | Total Duration | 1s |
Total Number of Test Cases | 47 | Fastest Test | 14ms |
Number of Manual Test Cases | 0 | Slowest Test | 40ms |
Tests Started | Apr 11, 2023 10:42:08 | Average Execution Time | 20ms |
Tests Finished | Apr 11, 2023 10:42:09 | Total Execution Time | 1s |
feature | Scenario | Context | Steps | Started | Total Duration | Result |
---|---|---|---|---|---|---|
SDATE Function |
1: The start date do not involve last day of month
description=next month, start date=2021-09-20, relative delta=months=+1, relative date=2021-10-20 |
3 | 10:42:08 | 018ms | ||
SDATE Function |
2: The start date do not involve last day of month
description=last month, start date=2021-09-20, relative delta=months=-1, relative date=2021-08-20 |
3 | 10:42:08 | 022ms | ||
SDATE Function |
3: The start date do not involve last day of month
description=next two months, start date=2021-09-20, relative delta=months=+2, relative date=2021-11-20 |
3 | 10:42:08 | 029ms | ||
SDATE Function |
4: The start date do not involve last day of month
description=next month, plus one week, start date=2021-09-20, relative delta=months=+1, weeks=+1, relative date=2021-10-27 |
3 | 10:42:08 | 030ms | ||
SDATE Function |
5: The start date do not involve last day of month
description=one month before one year, start date=2021-09-20, relative delta=years=+1, months=-1, relative date=2022-08-20 |
3 | 10:42:08 | 026ms | ||
SDATE Function |
6: The start date do not involve last day of month
description=one month after one year, start date=2021-09-20, relative delta=years=+1, months=+1, relative date=2022-10-20 |
3 | 10:42:08 | 031ms | ||
SDATE Function |
7: The start date do not involve last day of month
description=next ten days, start date=2021-09-20, relative delta=days=+10, relative date=2021-09-30 |
3 | 10:42:08 | 020ms | ||
SDATE Function |
8: The start date do not involve last day of month
description=next twelve days, start date=2021-09-20, relative delta=days=+12, relative date=2021-10-02 |
3 | 10:42:08 | 032ms | ||
SDATE Function |
9: The start date do not involve last day of month
description=next friday, start date=2021-09-20, relative delta=weekday=FR, relative date=2021-09-24 |
3 | 10:42:08 | 039ms | ||
SDATE Function |
10: The start date do not involve last day of month
description=last friday in this month, start date=2021-09-20, relative delta=weekday=FR(-1), relative date=2021-09-17 |
3 | 10:42:08 | 024ms | ||
SDATE Function |
11: The start date do not involve last day of month
description=next monday(it’s today!), start date=2021-09-20, relative delta=weekday=MO, relative date=2021-09-20 |
3 | 10:42:08 | 016ms | ||
SDATE Function |
12: The start date do not involve last day of month
description=next monday, but not today, start date=2021-09-20, relative delta=days=+1, weekday=MO, relative date=2021-09-27 |
3 | 10:42:08 | 020ms | ||
SDATE Function |
13: The start date do not involve last day of month
description=first saturday in next month, start date=2021-09-20, relative delta=months=+1, weekday=SA, relative date=2021-10-23 |
3 | 10:42:08 | 014ms | ||
SDATE Function |
1: The start date with 31 as last day
description=next month, start date=2021-01-31, relative delta=months=+1, relative date=2021-02-28 |
3 | 10:42:08 | 014ms | ||
SDATE Function |
2: The start date with 31 as last day
description=last month, start date=2021-01-31, relative delta=months=-1, relative date=2020-12-31 |
3 | 10:42:08 | 016ms | ||
SDATE Function |
3: The start date with 31 as last day
description=next two months, start date=2021-01-31, relative delta=months=+2, relative date=2021-03-31 |
3 | 10:42:08 | 015ms | ||
SDATE Function |
4: The start date with 31 as last day
description=next three months, start date=2021-01-31, relative delta=months=+3, relative date=2021-04-30 |
3 | 10:42:08 | 015ms | ||
SDATE Function |
5: The start date with 31 as last day
description=next month, plus one week, start date=2021-01-31, relative delta=months=+1, weeks=+1, relative date=2021-03-07 |
3 | 10:42:08 | 017ms | ||
SDATE Function |
6: The start date with 31 as last day
description=one month before one year, start date=2021-01-31, relative delta=years=+1, months=-1, relative date=2021-12-31 |
3 | 10:42:08 | 018ms | ||
SDATE Function |
7: The start date with 31 as last day
description=one month after one year, start date=2021-01-31, relative delta=years=+1, months=+1, relative date=2022-02-28 |
3 | 10:42:08 | 017ms | ||
SDATE Function |
8: The start date with 31 as last day
description=one month after three year (2024 leap year!), start date=2021-01-31, relative delta=years=+3, months=+1, relative date=2024-02-29 |
3 | 10:42:08 | 016ms | ||
SDATE Function |
9: The start date with 31 as last day
description=next ten days, start date=2021-01-31, relative delta=days=+10, relative date=2021-02-10 |
3 | 10:42:08 | 016ms | ||
SDATE Function |
10: The start date with 31 as last day
description=next friday, start date=2021-01-31, relative delta=weekday=FR, relative date=2021-02-05 |
3 | 10:42:08 | 015ms | ||
SDATE Function |
11: The start date with 31 as last day
description=last friday in this month, start date=2021-01-31, relative delta=weekday=FR(-1), relative date=2021-01-29 |
3 | 10:42:08 | 016ms | ||
SDATE Function |
1: The start date involve last day of february
description=next month, start date=2021-02-28, relative delta=months=+1, relative date=2021-03-28 |
3 | 10:42:08 | 016ms | ||
SDATE Function |
2: The start date involve last day of february
description=last month, start date=2021-02-28, relative delta=months=-1, relative date=2021-01-28 |
3 | 10:42:08 | 015ms | ||
SDATE Function |
3: The start date involve last day of february
description=next two months, start date=2021-02-28, relative delta=months=+2, relative date=2021-04-28 |
3 | 10:42:08 | 018ms | ||
SDATE Function |
4: The start date involve last day of february
description=next three months, start date=2021-02-28, relative delta=months=+3, relative date=2021-05-28 |
3 | 10:42:08 | 021ms | ||
SDATE Function |
5: The start date involve last day of february
description=next year, start date=2021-02-28, relative delta=years=+1, relative date=2022-02-28 |
3 | 10:42:08 | 028ms | ||
SDATE Function |
6: The start date involve last day of february
description=next three year (2024 leap year!), start date=2021-02-28, relative delta=years=+3, relative date=2024-02-28 |
3 | 10:42:08 | 016ms | ||
SDATE Function |
1: The months with different numbers of days
description=next month, start date=2021-01-27, relative delta=months=+1, relative date=2021-02-27 |
3 | 10:42:08 | 017ms | ||
SDATE Function |
2: The months with different numbers of days
description=next month, start date=2021-01-28, relative delta=months=+1, relative date=2021-02-28 |
3 | 10:42:09 | 017ms | ||
SDATE Function |
3: The months with different numbers of days
description=next month, start date=2021-01-29, relative delta=months=+1, relative date=2021-02-28 |
3 | 10:42:09 | 017ms | ||
SDATE Function |
4: The months with different numbers of days
description=next month, start date=2021-01-30, relative delta=months=+1, relative date=2021-02-28 |
3 | 10:42:09 | 016ms | ||
SDATE Function |
5: The months with different numbers of days
description=next month, start date=2021-01-31, relative delta=months=+1, relative date=2021-02-28 |
3 | 10:42:09 | 016ms | ||
SDATE Function |
6: The months with different numbers of days
description=next two months, start date=2021-01-31, relative delta=months=+2, relative date=2021-03-31 |
3 | 10:42:09 | 017ms | ||
SDATE Function |
7: The months with different numbers of days
description=next three months, start date=2021-01-31, relative delta=months=+3, relative date=2021-04-30 |
3 | 10:42:09 | 017ms | ||
SDATE Function |
1: The time addition
description=next hour, start date=2021-10-20T16:10:59, relative delta=hours=+1, relative date=2021-10-20T17:10:59 |
3 | 10:42:09 | 018ms | ||
SDATE Function |
2: The time addition
description=last hour, start date=2021-10-20T16:10:59, relative delta=hours=-1, relative date=2021-10-20T15:10:59 |
3 | 10:42:09 | 040ms | ||
SDATE Function |
3: The time addition
description=next ten hours, start date=2021-10-20T16:10:59, relative delta=hours=+10, relative date=2021-10-21T02:10:59 |
3 | 10:42:09 | 029ms | ||
SDATE Function |
4: The time addition
description=next 24 hours, start date=2021-10-20T16:10:59, relative delta=hours=+24, relative date=2021-10-21T16:10:59 |
3 | 10:42:09 | 033ms | ||
SDATE Function |
5: The time addition
description=next hour and ten minutes, start date=2021-10-20T16:10:59, relative delta=hours=+1, minutes=+10, relative date=2021-10-20T17:20:59 |
3 | 10:42:09 | 035ms | ||
SDATE Function |
6: The time addition
description=next 60 minutes, start date=2021-10-20T16:10:59, relative delta=minutes=+60, relative date=2021-10-20T17:10:59 |
3 | 10:42:09 | 024ms | ||
SDATE Function |
7: The time addition
description=next second, start date=2021-10-20T16:10:59, relative delta=seconds=+1, relative date=2021-10-20T16:11:00 |
3 | 10:42:09 | 021ms | ||
SDATE Function |
8: The time addition
description=next day, plus one hour, start date=2021-10-20T16:10:59, relative delta=days=+1, hours=+1, relative date=2021-10-21T17:10:59 |
3 | 10:42:09 | 022ms | ||
SDATE Function |
9: The time addition
description=one day after one month, plus one hour, start date=2021-10-20T16:10:59, relative delta=months=+1, days=+1, hours=+1, relative date=2021-11-21T17:10:59 |
3 | 10:42:09 | 015ms | ||
SDATE Function |
10: The time addition
description=one day after one month, plus one hour, start date=2021-01-31T16:10:59, relative delta=months=+1, days=+1, hours=+1, relative date=2021-03-01T17:10:59 |
3 | 10:42:09 | 017ms |