Home > Date And Time > Relative date time > SDATE Function > The months with different numbers of days
Report generated 11-04-2023 10:42

SDATE Function

  Sdate   Windows   Relative Date   Date

The months with different numbers of days

Adding month(s) will never cross the month boundary.

Scenario Outline

Given the date <start date>
When relative delta <relative delta> is applied
Then the relative date should be <relative date>

Examples: 

# Description Start Date Relative Delta Relative Date
1 next month 2021-01-27 months=+1 2021-02-27
2 next month 2021-01-28 months=+1 2021-02-28
3 next month 2021-01-29 months=+1 2021-02-28
4 next month 2021-01-30 months=+1 2021-02-28
5 next month 2021-01-31 months=+1 2021-02-28
6 next two months 2021-01-31 months=+2 2021-03-31
7 next three months 2021-01-31 months=+3 2021-04-30
Steps Outcome
SUCCESS 017ms
SUCCESS 017ms
SUCCESS 017ms
SUCCESS 016ms
SUCCESS 016ms
SUCCESS 017ms
SUCCESS 017ms
SUCCESS 0.15s
Serenity BDD version 3.6.22