Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DateTimeOffset myCalendar.GetDateTime(relativeDateduration: string, offset: ( Date | DateTimeOffset ))

Arguments

string relativeDate duration
Specifies the relative date time value in duration format. (Ex: 4.00:00:00 or P4DT0H0M0S)Duration in the "d.hh:mm:ss" or ISO-8601 duration format
( Date | DateTimeOffset ) offset
Specifies the offset value for relative date time. Optional, if not specified current date time is used.

Returns

Remarks

This method adds the duration to given to offset or current date and then finds the next business date time by calendar rules. Resulting value may be not exactly added duration. If just need to add duration in business hours, please use Calendar.AddTimeSpan method instead.

Warning

Duration This method adds the duration standard calendar and returns the next business date time.

Example

For 09:00-18:00 business hours, adding 2 hours to 17:00 results next day 09:00 not 10:00

Code Block
languagejs
var nextDate = $Calendar.GetDateTime('PT2H', DateTimeOffset.parse('2023-02-08T17:00'));
// nextDate will be set to '2020-02-09T09:00'