You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The number of days between datetimes.

Days = SRP_DateTime("DaySpan", FromDateTime, ToDateTime, Fractional)

Returns

The number of days between two datetimes

Parameters

ParameterDescription
FromDateTimeA starting datetime in OI internal format. (REQUIRED)
ToDateTimeAn ending datetime in OI internal format. (REQUIRED)
FractionalDetermines if the span should be in whole days or fractional days. (OPTIONAL)

Remarks

The "DaySpan" service calculates the number of days between two datetimes. The result will be positive if the starting datetime comes before the ending datetime and negative if the ending date comes first.

If Fractional is set to 1, which is the default, you will get a decimal number if the time of days are not equal. If you want whole days only, set Fractional to 0.

Examples

// Get the number of days between two dates
From = SRP_DateTime("Parse", "Monday, December 8, 1941 at 7:51:43am", "DDD, MMMM D, YYYY at h:mm:sstt")
To = SRP_DateTime("Parse", "Thursday, March 30, 1978 at 12:41:08pm", "DDD, MMMM D, YYYY at h:mm:sstt")
Days = SRP_DateTime("DaySpan", From, To)


// Get the number of whole days
Days = SRP_DateTime("DaySpan", From, To, 0)
  • No labels