Codecore Logo
Quick Search
»
Advanced Search »

DateTime Driver

RSS
This driver triggers events based on date and time, time intervals and sunrise/sunet.

Manufacturer: N/A


Configuration Settings

  • Latitude : The latitude for sunrise/sunset calculations. Valid format examples are:
    -35.123 (Negative for South & West)
    35° 7' 22.8" S
    35 deg 7 min 22.8 sec S

When using the geographic coordinates, do not use a negative sign since it is implied by entering W. When using the decimal format, use a negative sign only for South.
  • Longitude : The longitude for sunrise/sunset calculations. Valid format examples are:
    -35.123 (Negative for South & West)
    35° 7' 22.8" W
    35 deg 7 min 22.8 sec W

When using the geographic coordinates, do not use a negative sign since it is implied by entering S. When using the decimal format, use a negative sign only for West.
  • Time Zone : (optional) The timezone for all date calculations used in this device. Defaults to the local timezone of the driver service. The time zone is used to calculate the UTC offset and to determine when DST is being observed.

Events

Ready State Changed

The device's running and ready state changed.

Whenever Filter:

none

EventArgs:

  • Number NewValue : The new property value.
  • Number PreviousValue : The previous property value.

At Sunrise

Occurs at a sunrise.

Whenever Filter:

  • DaysOfWeek : Indicates the days on which the rule should be run.

EventArgs:

none

At Sunset

Occurs at a sunset.

Whenever Filter:

  • DaysOfWeek : Indicates the days on which the rule should be run.

EventArgs:

none

At a Specific Date & Time

Occurs once at a specific date and time.

Whenever Filter:

  • DateTime : Specifies the exact date and time when the event will occur.

EventArgs:

none

Daily At a Specific Time

Occurs every day at a specific time.

Whenever Filter:

  • DaysOfWeek : Indicates the days on which the rule should be run.
  • Time : Specifies the exact time in 24 hour ISO time format: HH:MM:SS

EventArgs:

none

Every # of Seconds

Occurs every X seconds.

Whenever Filter:

  • DaysOfWeek : Indicates the days on which the rule should be run.
  • Seconds : Specifies the numeric interval in seconds.

EventArgs:

none

Every # of Minutes

Occurs every X minutes.

Whenever Filter:

  • Minutes : Specifies the numeric interval in minutes.
  • DaysOfWeek : Indicates the days on which the rule should be run.

EventArgs:

none

Every # of Hours

Occurs every X hours.

Whenever Filter:

  • DaysOfWeek : Indicates the days on which the rule should be run.
  • Hours : Specifies the numeric interval in hours.

EventArgs:

none

At Random Intervals

Occurs at random intervals between a specified minimum and maximum duration.

Whenever Filter:

  • DaysOfWeek : Indicates the days on which the rule should be run.
  • MinimumInterval : Specifies the minimum interval duration in the format HH:MM:SS, where 1hr & 30min would be 01:30:00.
  • MaximumInterval : Specifies the maximum interval duration in the format HH:MM:SS, where 2hr & 45min would be 02:45:00.

EventArgs:

none

At Scheduled Intervals

Occurs based on an advanced schedule.

Whenever Filter:

  • EndType : Specify if and how the schedule will end.
  • EndByDateAndTime : (optional) Enter the date and time at which no more recurrences will occur. This is only applicable if the End Type is set to End by a Specific Date.
  • EndAfterOccurances : (optional) Enter the number of times this event will occur. This is only applicable if the End Type is set to End After a # of Occurances.
  • RecurrenceType : The frequency of occurrences for the recurrence pattern.
  • StartDateAndTime : Enter the date and time of the first occurance.
  • Interval : The number of units of a given recurrence type between occurrences. For example, setting the Interval to 2 and the Recurrence Type to Weekly would cause the event to occur every second week.

EventArgs:

none

Instance Properties

IsDarkOutside

Gets a value indicating if it is dark outside.

Accessibility : Read Only

Type: Boolean

IsLightOutside

Gets a value indicating if it is light outside.

Accessibility : Read Only

Type: Boolean

Sunrise

Gets the date/time of the next sunrise. This could be tomorrow if today's sunset has already occurred.

Accessibility : Read Only

Type: DateTime

Sunset

Gets the date/time of the next sunset. This could be tomorrow if today's sunset has already occurred.

Accessibility : Read Only

Type: DateTime

CurrentDateTime

Gets the current date/time in the device's timezone.

Accessibility : Read Only

Type: DateTime

DayOfWeek

Gets the day of the week. 0=Sunday, 1=Monday, etc.

Accessibility : Read Only

Type: Number

DayOfYear

Gets the day of the year.

Accessibility : Read Only

Type: Number

Day

Gets today's day of the month.

Accessibility : Read Only

Type: Number

Month

Gets today's month of the year.

Accessibility : Read Only

Type: Number

Year

Gets today's year.

Accessibility : Read Only

Type: Number

Hour

Gets the current time's hour component.

Accessibility : Read Only

Type: Number

Minute

Gets the current time's minute component.

Accessibility : Read Only

Type: Number

Second

Gets the current time's second component.

Accessibility : Read Only

Type: Number

Millisecond

Gets the current time's millisecond component.

Accessibility : Read Only

Type: Number

IsWeekday

Gets a value indicating today's date is a weekday day (Monday through Friday).

Accessibility : Read Only

Type: Boolean

IsWeekend

Gets a value indicating today's date is a weekend day (Saturday or Sunday).

Accessibility : Read Only

Type: Boolean

MoonPhases

Gets the moon phases for the next 30 days.

Accessibility : Read Only

Type: Array

DeviceDisplayName

The display name for this device.

Accessibility : Read Only

Type: String

DeviceStartTime

The date and time when this device was started.

Accessibility : Read Only

Type: DateTime

DeviceLifecycleStage

The current lifecycle stage of the device. The stages in order are: Pending Start, Starting, Running, Stopping

Accessibility : Read Only

Type: Number

DeviceIsRunningAndReady

Indicates if the device is ready for use, ie it is in the Running lifecycle stage and all properties are valid and all methods are ready to be used.

Accessibility : Read Only

Type: Boolean

Instance Methods

OffsetDays ( Number )

Gets the current date/time offset by the specified number of days.

Syntax

DateTime OffsetDays( Number days )

Parameters

days : A number of whole and fractional days. The value can be negative or positive.

OffsetHours ( Number )

Gets the current date/time offset by the specified number of hours.

Syntax

DateTime OffsetHours( Number hours )

Parameters

hours : A number of whole and fractional hours. The value can be negative or positive.

OffsetMilliseconds ( Number )

Gets the current date/time offset by the specified number of milliseconds.

Syntax

DateTime OffsetMilliseconds( Number milliseconds )

Parameters

milliseconds : A number of whole and fractional milliseconds. The value can be negative or positive. Note that this value is rounded to the nearest integer.

OffsetMinutes ( Number )

Gets the current date/time offset by the specified number of minutes.

Syntax

DateTime OffsetMinutes( Number minutes )

Parameters

minutes : A number of whole and fractional minutes. The value can be negative or positive.

OffsetMonths ( Number )

Gets the current date/time offset by the specified number of months.

Syntax

DateTime OffsetMonths( Number months )

Parameters

months : A number of months. The months can be negative or positive.

OffsetSeconds ( Number )

Gets the current date/time offset by the specified number of seconds.

Syntax

DateTime OffsetSeconds( Number seconds )

Parameters

seconds : A number of whole and fractional seconds. The value can be negative or positive.

OffsetYears ( Number )

Gets the current date/time offset by the specified number of years.

Syntax

DateTime OffsetYears( Number years )

Parameters

years : A number of years. The value can be negative or positive.

GetMoonPhase ( DateTime )

Gets the moon phase for the specified date.

Syntax

Number GetMoonPhase( DateTime date )

Parameters

date : The date.

SetPropertyForDuration ( String, TimeSpan, Object, Object )

Sets a property for a duration of time and then sets the property to a subequent value asynchronously. This action returns after setting the first value and the timer and subsequent property set run in the background. Subsequent sets of the same property will reset the timer if the subsequent value has not yet been set. This is an advanced feature, be sure to set the property name correctly.

Syntax

void SetPropertyForDuration( String propertyName, unknown duration, Object initialValue, Object finalValue )

Parameters

propertyName : The name of the property to set.
duration : The amount of time to wait after setting the initial value to set the subsequent value.
initialValue : The value to set the property to initially.
finalValue : The value to set the property to after the duration of time has passed.

SetPropertyForDuration ( String, Number, TimeSpan, Object, Object )

Sets a property for a duration of time and then sets the property to a subequent value asynchronously. This action returns after setting the first value and the timer and subsequent property set run in the background. Subsequent sets of the same property will reset the timer if the subsequent value has not yet been set. This is an advanced feature, be sure to set the property name correctly.

Syntax

void SetPropertyForDuration( String propertyName, Number arrayIndex, unknown duration, Object initialValue, Object finalValue )

Parameters

propertyName : The name of the property to set.
arrayIndex : The property's array index to set.
duration : The amount of time to wait after setting the initial value to set the subsequent value.
initialValue : The value to set the property to initially.
finalValue : The value to set the property to after the duration of time has passed.

Privacy Policy | Conditions Of Use

Copyright ©2014 Codecore Technologies, All rights reserved.