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

DateTime Object Type

Previous page Next page
  rev. 2011-02-09        

Description:

An object which represents a date and time.

Properties:

Name

Type

Description

Year

Numeric

Gets the year represented by this instance.

Month

Numeric

Gets the month represented by this instance

Day

Numeric

Gets the day represented by this instance.

DayOfYear

Numeric

Gets the day of the year represented by this instance.

Hour

Numeric

Gets the hour represented by this instance.

Minute

Numeric

Gets the minute represented by this instance.

Second

Numeric

Gets the second represented by this instance.

IsWeekend

Boolean

Indicates whether the date represented by this instance is either Saturday or Sunday.

IsWeekday

Boolean

Indicates whether the date represented by this instance is a week day.

Operators:

Expression

Returns

DateTime + TimeSpan

DateTime

DateTime - TimeSpan

DateTime

DateTime - DateTime

TimeSpan

DateTime == DateTime & DateTime != DateTime

Boolean

DateTime > DateTime & DateTime >= DateTime

Boolean

DateTime < DateTime, DateTime <= DateTime

Boolean

Examples:

Expression

Result

DateTime(2009,1,20,17,35,0)

1/20/2009 5:35:00 PM

Date(2009,1,20).IsWeekday

True

Get the difference between two dates.

Expression

Result

Date(2009,1,20) - DateTime(2009,1,10,12,30,0)

9.11:30:00

(Date(2009,1,20) - DateTime(2009,1,10,12,30,0)).Hours

227.5

Date(2009,1,20) > Date(2001,1,1)

True

Compare two dates

Expression

Result

Date(2009,1,20) > Date(2001,1,1)

True

 



snippet_DateTime_Object_Type         ©2014 Managing Energy Inc.