This is part of 3.33.0latest release.

CALENDAR

1.3.0
since lib: v3.1.0  

A variable type `CALENDAR` can be used for to provide module wide calendar data. In the section date and time functions are various functions to update the calendar continuously.

A variable type CALENDAR can be used for to provide module wide calendar data. In the section date and time functions are various functions to update the calendar continuously.

Version history

1.3.0

  hm

Changes

Changed:
  • sun_rise, sun_set and sun_midday are now calculated in local time
show full history

1.2.0

  hm

Changes

Added:
  • work_week
  • sun_midday
  • sun_heigth

1.1.0

  hm

Changes

Added:
  • sun position data

1.0.0

  hm

Changes

Added:
  • original version

Overview

nametypedefaultcomment
UTCDTWorld time UTC
LDTDTLocal time
LDATEDATELocal date
LTODTODLocal time of day
YEARINTYear of LDATE
MONTHINTMonth of LDATE
DAYINTDay of LDATE
WEEKDAYINTWeekday of LDATE
OFFSETINTTime Zone Offset for Local time in minutes
DST_ENBOOLDaylight savings time enable
DST_ONBOOLTrue when daylight savings time os on
NAMESTRING(5)Name of time zone
LANGUAGEINTLocation number pls see location setup
LONGITUDEREALLongitude of current location
LATITUDEREALLatitude of current location
SUN_RISETODSun_rise for current location
SUN_SETTODSun_set for current location
SUN_MIDDAYTODWorldtime when sun stands at south position
SUN_HEIGTHREALSuns heigth at midday, south position
SUN_HORREALSun angle horizontal 0 = north in degrees
SUN_VERREALSun angle vertical above horizon in degrees
NIGHTBOOLTrue between sun_set and sun_rise
HOLIDAYBOOLTrue when holiday
HOLY_NAMESTRING(30)Name of holiday
WORK_WEEKINTCurrent work week

Details

UTC

DT

World time UTC.

LDT

DT

Local time.

LDATE

DATE

Local date.

LTOD

TOD

Local time of day.

YEAR

INT

Year of LDATE.

MONTH

INT

Month of LDATE.

DAY

INT

Day of LDATE.

WEEKDAY

INT

Weekday of LDATE.

OFFSET

INT

Time Zone Offset for Local time in minutes.

DST_EN

BOOL

Daylight savings time enable.

DST_ON

BOOL

True when daylight savings time os on.

NAME

STRING(5)

Name of time zone.

LANGUAGE

INT

Location number pls see location setup.

LONGITUDE

REAL

Longitude of current location.

LATITUDE

REAL

Latitude of current location.

SUN_RISE

TOD

Sun_rise for current location.

SUN_SET

TOD

Sun_set for current location.

SUN_MIDDAY

TOD

Worldtime when sun stands at south position.

SUN_HEIGTH

REAL

Suns heigth at midday, south position.

SUN_HOR

REAL

Sun angle horizontal 0 = north in degrees.

SUN_VER

REAL

Sun angle vertical above horizon in degrees.

NIGHT

BOOL

True between sun_set and sun_rise.

HOLIDAY

BOOL

True when holiday.

HOLY_NAME

STRING(30)

Name of holiday.

WORK_WEEK

INT

Current work week.

Source code

Declarations

(*Data type for module wide calendar data*)
TYPE index : 

(*
 * -----------------------------------------------------------------------------
 * Name               : index
 * Version            : 1.3.0
 * Date               : 2010-01-23
 * Author             : hm
 * 
 * -----------------------------------------------------------------------------
 * Data type for module wide calendar data
 * -----------------------------------------------------------------------------
 *)

STRUCT
  UTC : DT; (*World time UTC*)
  LDT : DT; (*Local time*)
  LDATE : DATE; (*Local date*)
  LTOD : TOD; (*Local time of day*)
  YEAR : INT; (*Year of LDATE*)
  MONTH : INT; (*Month of LDATE*)
  DAY : INT; (*Day of LDATE*)
  WEEKDAY : INT; (*Weekday of LDATE*)
  OFFSET : INT; (*Time Zone Offset for Local time in minutes*)
  DST_EN : BOOL; (*Daylight savings time enable*)
  DST_ON : BOOL; (*True when daylight savings time os on*)
  NAME : STRING(5); (*Name of time zone*)
  LANGUAGE : INT; (*Location number pls see location setup*)
  LONGITUDE : REAL; (*Longitude of current location*)
  LATITUDE : REAL; (*Latitude of current location*)
  SUN_RISE : TOD; (*Sun_rise for current location*)
  SUN_SET : TOD; (*Sun_set for current location*)
  SUN_MIDDAY : TOD; (*Worldtime when sun stands at south position*)
  SUN_HEIGTH : REAL; (*Suns heigth at midday, south position*)
  SUN_HOR : REAL; (*Sun angle horizontal 0 = north in degrees*)
  SUN_VER : REAL; (*Sun angle vertical above horizon in degrees*)
  NIGHT : BOOL; (*True between sun_set and sun_rise*)
  HOLIDAY : BOOL; (*True when holiday*)
  HOLY_NAME : STRING(30); (*Name of holiday*)
  WORK_WEEK : INT; (*Current work week*)
END_STRUCT
END_TYPE