Skip to content

DateCompare

David Rivard edited this page Dec 30, 2020 · 1 revision

DateCompare (driv_DateCompare)

This API is used to provide comparison information about 2 dates.

Parameters

Input Parameters

Parameter Type Description Required
Date1 DateTime Date #1 to analyze X
Date2 DateTime Date #2 to analyze X

Output Properties

Property Type Description
SameYear Boolean Are the 2 dates in the same Year
SameMonth Boolean Are the 2 dates in the same month (Regardless of the year)
SameDay Boolean Are the 2 dates the same day of the month (Regardless of the month and the year)
DaysBetween Integer Number of days between the 2 dates

Usage

WebApi:

Request https://{{baseurl}}/api/data/v9.1/driv_DateCompare

{
    "Date1" : "2020-12-25"
    "Date2" : "2021-12-25"
}

Response

{
    "@odata.context": "https://{{baseurl}}/api/data/v9.1/$metadata#Microsoft.Dynamics.CRM.driv_DateCompareResponse",
    "SameYear": false,
    "SameMonth": true,
    "SameDay": true,
    "DaysBetween": 365
}

Power Automate: