Skip to content

GetDateTimeAsync

Returns the next valid date and time, according to calendar rules, after adding a given duration.

1
myCalendar.GetDateTimeAsync(relativeDate: string, offset: ( Date | DateTimeOffset )):Promise<DateTimeOffset>

Parameters

string relativeDate
    The duration string to add.

( Date | DateTimeOffset ) offset
    Specifies the offset value for relative date time. Optional, if not specified, the current date time is used.

Returns

A Promise that resolves to a DateTimeOffset representing the next valid date and time by calendar rules.

Remarks

Example

1
2
var nextDate = await $Calendar.GetDateTimeAsync('PT2H', DateTimeOffset.parse('2023-02-08T17:00'));
// nextDate will be set to '2020-02-09T09:00'

See Also