XenoGuard Documentation

Date/Time Show

Actions » Programming » Time » Date/Time Show

The action Date/Time Show displays the current date and time based on a specified format and stores the Date/Time, Day, Month, Year, Hour, Minute, Second, Millisecond, Day of the Week, Day of the Year, and Ticks of the result list.

[-] Hide
  1. Open the Programming node in the Workspace Explorer.
  2. In the Time node, select the Date/Time Show action.

Parameters:

The action has the following input parameters:


name Description
Format
Specifies the format of the Date and Time

Allowed Context Scopes
[Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum] 
[-] Hide

Here are some characters that can be used to specify the Date and Time format:

  • dd - represents the day of the month (01 to 31); a single character removes the leading zero
  • ddd - represents the abbreviated name of the day of the week
  • dddd - represents the full name of the day of the week
  • MM - represents a month (01 to 12); a single character removes the leading zero
  • MMM - represents the abbreviated name of the month (Jan. to Dec.) 
  • MMMM - represents the full name of the month (January to December)
  • yy - represents a year (last two digits)
  • yyyy - represents a year (in four digits)
  • HH - 24-hour format of an hour (00 to 23)
  • hh - 12-hour format of an hour with leading zeros (01 to 12); a single character removes the leading zero 
  • mm - minutes with leading zeros (00 to 59); a single character removes the leading zero 
  • ss - seconds with leading zeros (00 to 59); a single character removes the leading zero
  • fffffff - ten-millionths of a second in a date and time value
  • tt - displays either Ante Meridiem or Post Meridiem (AM or PM)
  • K - shows the time zone information
Information The date format depends on the selected country language.

Results:

The action returns the following results:


name
description
Date/Time Contains the date and time.
Day Contains the current day.
Month Contains the current month.
Year Contains the current year.
Hour Contains the current hour .
Minute Contains the current minute.
Second Contains the current second.
Millisecond Contains the current millisecond.
Day of the Week Contains the current days of the week.
Day of the Year Contains the current day of the year.
Ticks Contains the system ticks of the date and time.

Information

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]

All values of the result list are determined by the specified format.

Example 1 (Display the current date and time using the default format):

This example shows the current date and time from the system clock. The result of the Date/Time is then output via Write Text.

Example 2 (Display the current day of the week):

This example shows the current day of the week from the system clock. The result of the Day of the Week is then output via Message Box.

Example 3 (Display the current 12-hour time format):

This example shows the current time from the system clock in a 12-hour format. The result of the Date/Time Show is set as the identifier of the local WriteDateTime_Time variable with Text as data type. The Value of the set identifier is then output via Write Text.

See other time operations:

Wait Milliseconds
Stopwatch Start
Stopwatch Stop
Date/Time Subtract
Date/Time Offset
Date/Time to Ticks
Date/Time From Ticks