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

DateRange Object Type

Previous page Next page
  rev. 2011-02-09        

Description:

An object which represents a span of time with specific start and end dates.

 

                                                               DateRange objects extend from midnight at the beginning of the start date to midnight at the beginning of the end date.  For example, a span covering the month of March 2010 would be from March 1,2010 to April 1,2010.  It would be represented as 3/01/2010 12:00:00 AM - 4/01/2010 12:00:00 AM

 

Properties:

Argument

Type

Description

Start

DateTime

The start of the date range.

End

DateTime

The end of the date range.

Span

TimeSpan

The time span represented by this date range.

Days

Numeric

The number of days within this date range. (Shorthand to accessing Span.Days)

Methods:

Argument

Returns

Description

InPeriod

TimeSpan

Gets the portion of the date range which falls within the specified period, in elapsed time units.

FractionInPeriod

Numeric

Gets the fraction of the date range which falls within a specified period; a number from 0 to 1.0

DaysInPeriod

Numeric

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

Example:

Create a date range representing the period from Jun 10 2009 until July 27 2009.

Expression

Result

DateRange(Date(2009,6,10), Date(2009,7,27))

6/10/2009 12:00:00 AM - 7/27/2009 12:00:00 AM

Get the number of days in the above period.

Expression

Result

DateRange(Date(2009,6,10), Date(2009,7,27)).Days

47



snippet_DateRange_Object_Type         ©2014 Managing Energy Inc.