Date and Time
You can include date and time values in your expressions. These can be just a date, just a time, or both a date and time. There are 2 different formats for dates, one is called the short format and the other is called the long format.
The syntax for short date and time values is:
#<Day>/<Month No.>/<Year> <Hrs>:<Mins>:<Secs>.<Fraction>#
The syntax for long date and time values is:
#<Day> <Month Name> <Year> <Hrs>:<Mins>:<Secs>.<Fraction>#
Where:
<Day>
is a number between 1 and 31<Month No.>
is a number between 1 and 12 and represents the month. When you use numbers for the month, you have to use forward slashes as separators.<Month Name>
is the name of the month. It can be long (the name in full, for example, OCTOBER) or can be short (an abbreviation, for example, OCT). When you enter the name of the month, you have to use spaces as separators instead of forward slashes.<Year>
is a 2 digit or 4 digit number for the year. When 2 digits are used, numbers below 25 are for the 21st Century and numbers above 25 are used for the 20th Century.If you only want a time value, you can choose to leave out the day, month number or month name, and year.
<Hrs>
is a number between 00 and 23 and represents the hours (24 hour clock).<Mins>
is a number between 00 and 59 and represents the minutes.<Secs>
is a number between 00 and 59 and represents the seconds. The seconds are optional and can be excluded. They are treated as 00 if you do not use them in your expression.<Fraction>
is a number that represents the deciseconds, centiseconds, or milliseconds. If you enter 1 digit, the number is for deciseconds; enter 2 digits and the number is for centiseconds; enter a third digit and the number is for milliseconds.If you only require a date value, you can leave out the hours, minutes and seconds. This will return a date with midnight as the time (by default).
- Forward slashes ( / ) are used to separate the date sections (Day, Month, and Year) when the short date format is used. When the long date format is used, spaces have to be used instead of forward slashes.
- A space is used to separate the date and time.
- Colons (:) are used to separate hours, minutes, and seconds.
- A period (.) is used to separate the seconds from the fraction.
- A hash (#) has to be included at the start and end of the date and time value.
Example:
The following examples show the different types of date and time entry (some using the date only, others using the time only, and the final example using both date and time).
#12 Dec 2004#
#12 December 2004#
#15:25:56#
#15:25#
#12/05/04 15:25:56.43#
Time entries have to be in the Coordinated Universal Time (UTC) format.
Further Information
Time Zones: see Time Zone Support in ClearSCADA in the ClearSCADA Guide to Core Configuration.