Home > Date And Time > Relative date time > DATEDIF Function > The time substraction
Report generated 11-04-2023 10:42

DATEDIF Function

  Datedif   Date Time   Windows   Relative Delta

The time substraction

Scenario Outline

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: 

# Start Date End Date Relative Delta
1 2021-10-20T16:10:59 2021-10-20T17:10:59 hours=1
2 2021-10-20T16:10:59 2021-10-20T15:10:59 hours=-1
3 2021-10-20T16:10:59 2021-10-21T02:10:59 hours=10
4 2021-10-20T16:10:59 2021-10-21T16:10:59 days=1
5 2021-10-20T16:10:59 2021-10-20T17:20:59 hours=1, minutes=10
6 2021-10-20T16:10:59 2021-10-20T17:10:59 hours=1
7 2021-10-20T16:10:59 2021-10-20T16:11:00 seconds=1
8 2021-10-20T16:10:59 2021-10-21T17:10:59 days=1, hours=1
9 2021-10-20T16:10:59 2021-11-21T17:10:59 months=1, days=1, hours=1
10 2021-01-31T16:10:59 2021-03-01T17:10:59 months=1, days=1, hours=1
Steps Outcome
SUCCESS 018ms
SUCCESS 018ms
SUCCESS 017ms
SUCCESS 023ms
SUCCESS 031ms
SUCCESS 015ms
SUCCESS 018ms
SUCCESS 016ms
SUCCESS 016ms
SUCCESS 020ms
SUCCESS 0.24s
Serenity BDD version 3.6.22