-
Notifications
You must be signed in to change notification settings - Fork 1
TimeSpanMonths Operator
Martin Danielsson edited this page Jul 23, 2015
·
3 revisions
The TimeSpanMonths
operator calculates the time span in months between two date/time strings, taking a specific date/time format into account.
What | Type |
---|---|
Syntax | TimeSpanMonths(dateFrom, dateTo, format) |
dateFrom |
any |
dateTo |
any |
format |
string |
Return type | int |
This operator is kind of stupid. But this is what it does: It tries to parse both dateFrom
and dateTo
using the format
string; then it does the following calculation:
((toYear - fromYear) * 12 + (toMonth - endMonth))
If any or both date strings cannot be parsed using the format string, the transformation process will be cancelled, throwing an appropriate exception.
For a reference of valid date/time format strings, see
- https://msdn.microsoft.com/en-us/library/vstudio/8kb3ddd4(v=vs.100).aspx (Custom Date and Time Format Strings)