Calendar.Subtract
Overview
Subtracts specified number of hours from specified date time value and returns.
number myCalendar.Subtract(start:
DateTimeOffset, end:
DateTimeOffset)
Arguments
DateTimeOffset start
Specifies the base date time value.
DateTimeOffset end
Specifies the date time value that will be subtracted from start parameter.
Returns
The number of hours between start and end parameters.
Example
Subtract two date time values and returns the number of hours between them.
var hours = $Calendar.Subtract(DateTimeOffset.parse('2017-01-25T15:00'), DateTimeOffset.parse('2017-01-25T13:00'));
// hours will be set to 2
Copyright © 2010 - 2023 Emakin. All rights reserved.