Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

DateYear

  • Last UpdatedJul 18, 2023
  • 1 minute read

Gets the year from a time/date variable.

Note: Time/Date functions can only be used with dates between 1980 and 2035. You should check that the date you are using is valid with Cicode similar to the following:
IF StrToDate(Arg1)>0 THEN
...
ELSE
...
END

Syntax

DateYear(Time [, Mode] )

Time:

The time/date variable.

Mode:

The format required:

0 - Short year, yy. If you use this mode during the year 2000, 0 (zero) will be returned.

1 - Long year, yyyy

If omitted, the default Mode is 0.

Return Value

The year as an integer.

Note: In the year 2000, this function will return 0 (zero) if mode 0 (zero) is used.

Date

Example

! If the current system date is 3rd November 1991;

Variable=DateYear(TimeCurrent(),0);

! Sets Variable to 91.

! If the current system date is 18th October 2000;

Variable=DateYear(TimeCurrent(),0);

! Sets Variable to 0.

Variable=DateYear(TimeCurrent(),1);

! Sets Variable to 1991.

See Also

Time and Date Functions

In This Topic
TitleResults for “How to create a CRG?”Also Available in