You are not logged in! Log in or Register

DateTime

Description

A block that will output the date and or time as a string in a specified format.

Attributes

  • Format [string]: The format to use. The acceptable parameters are defined in the remarks.
  • Name [string]: The name of the block.
  • RefreshTrigger [trigger input]: A block that fires a trigger when the data should be refreshed.
  • String [string, readonly]: The last string output.

Output connectors

  • String: The date/time in string format.

Remarks

The following format parameters are accepted:

  • dddd: Represents the full name of the day of the week.
  • ddd: Represents the abbreviated name of the day of the week.
  • dd: Represents the day of the month as a number from 01 through 31.
  • d: Represents the day of the month as a number from 1 through 31.
  • MMMM: Represents the full name of the month.
  • MMM: Represents the abbreviated name of the month.
  • MM: Represents the month as a number from 01 through 12.
  • M: Represents the month as a number from 1 through 12.
  • yyyy: Represents the year as a four-digit number.
  • yyy: Represents the year with a three digits.
  • yy: Represents the year with a two digits.
  • y: Represents the year with a one digits.
  • hh: Represents the hour as a number from 01 through 12, in 12 hour format so 13h00 becomes 01h00.
  • h: Represents the hour as a number from 1 through 12, in 12 hour format so 13h00 becomes 1h00.
  • HH: Represents the hour as a number from 00 through 23, in 24 hour format.
  • H: Represents the hour as a number from 0 through 23, in 24 hour format.
  • mm: Represents the minute as a number from 00 through 59.
  • m: Represents the minute as a number from 0 through 59.
  • ss: Represents the seconds as a number from 00 through 59.
  • s: Represents the seconds as a number from 0 through 59.
  • tt: Represents the AM/PM designator.
  • T: Represents the first character of the AM/PM designator.
  • W: Represents the number of the week within the year.
  • D: Represents the number of the day within the year.

Example

 1 <DateTime Name="time" Format="HH:mm.ss dd/MM/yyyy" 
 2     RefreshTrigger="timer"/>
 3 <TimerTrigger Name="timer" Interval="1" Enabled="true"/>
 4 
 5 <VisualPage>
 6   <VisualContent>
 7     <VisualText Input="time"/>    
 8   </VisualContent>
 9 </VisualPage>
10 
11 <!-- This will display a simple clock -->
Example image

See also

User comments

Nothing comments yet. Be the first!

Leave a comment

You need to be logged in to post a comment.