DateTime Delta

Calculates a new DateTime value given an input DateTime value and a time difference (delta) from the input DateTime value.

Input: TextResult: HTML with a sandboxed preview

Text input

Run to see the result

Examples

Advance a UTC clock by 1 hours

Advance a UTC clock by 1 hours. This is a constructed public fixture.

Input

01/01/2025 00:00:00

Expected checks

Case-insensitive
Contains "01:00:00"
Built in formats
Standard date and time
Input format string
DD/MM/YYYY HH:mm:ss
Time Operation
Add
Days
0
Hours
1
Minutes
0
Seconds
0
Advance a UTC clock by 2 hours

Advance a UTC clock by 2 hours. This is a constructed public fixture.

Input

01/01/2025 00:00:00

Expected checks

Case-insensitive
Contains "02:00:00"
Built in formats
Standard date and time
Input format string
DD/MM/YYYY HH:mm:ss
Time Operation
Add
Days
0
Hours
2
Minutes
0
Seconds
0
Advance a UTC clock by 3 hours

Advance a UTC clock by 3 hours. This is a constructed public fixture.

Input

01/01/2025 00:00:00

Expected checks

Case-insensitive
Contains "03:00:00"
Built in formats
Standard date and time
Input format string
DD/MM/YYYY HH:mm:ss
Time Operation
Add
Days
0
Hours
3
Minutes
0
Seconds
0
Advance a UTC clock by 4 hours

Advance a UTC clock by 4 hours. This is a constructed public fixture.

Input

01/01/2025 00:00:00

Expected checks

Case-insensitive
Contains "04:00:00"
Built in formats
Standard date and time
Input format string
DD/MM/YYYY HH:mm:ss
Time Operation
Add
Days
0
Hours
4
Minutes
0
Seconds
0
Advance a UTC clock by 5 hours

Advance a UTC clock by 5 hours. This is a constructed public fixture.

Input

01/01/2025 00:00:00

Expected checks

Case-insensitive
Contains "05:00:00"
Built in formats
Standard date and time
Input format string
DD/MM/YYYY HH:mm:ss
Time Operation
Add
Days
0
Hours
5
Minutes
0
Seconds
0
DateTime Delta Negative

Input

20/02/2024 14:37:00

Expected rejection

Message contains
20/02/2024 13:37:00
Built in formats
Standard date and time
Input format string
DD/MM/YYYY HH:mm:ss
Time Operation
Subtract
Days
0
Hours
1
Minutes
0
Seconds
0
DateTime Delta Positive

Input

20/02/2024 13:36:00

Expected answer

20/02/2024 13:37:00
Built in formats
Standard date and time
Input format string
DD/MM/YYYY HH:mm:ss
Time Operation
Add
Days
0
Hours
0
Minutes
1
Seconds
0

Related tools

Browse date / time tools