Navigation:  Module 1 - Energy Accounting > Accounts & Invoices Tab > User Defined Components > Object Types > DateRange Object Type >

DaysInPeriod Method

Previous page Next page
  rev. 2011-02-09        

Description:

Gets the number of days in the date range which fall within the specified period.

Syntax:

[DateRange Object].DaysInPeriod( startMonth, startDay, endMonth, endDay)

[DateRange Object].DaysInPeriod( startDate, endDate) (year specific)

Arguments:

Argument

Type

Description

startMonth

Numeric

The start month (1-12)

startDay

Numeric

The start day

endMonth

Numeric

The end month (1-12)

endDay

Numeric

The end day

startDate

DateTime

The start date

endDate

DateTime

The end date

Returns:

The number of days which fall within the specified period.

Examples:

Get the number of days from the date range (2009-01-20 to 2009-06-15) which falls within Jan 1 to Feb 1.

Expression

Result

DateRange(Date(2009,1,20), Date(2009,6,15)).DaysInPeriod(1,1,2,1)

12

DateRange(Date(2009,1,20), Date(2009,6,15)).DaysInPeriod(Date(2009,1,1),Date(2009,2,1))

12

 



snippet_DaysInPeriod_Method         ©2014 Managing Energy Inc.