XenoGuard Documentation

Date/Time From Ticks

Actions » Programming » Time » Date/Time From Ticks

The action Date/Time From Ticks converts the number of ticks to a specified value and format and stores the Ticks, Day, Month, Year, Hour, Minute, Second, Millisecond, Day of the Week Day of the Year in the result list.

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

Parameters:

The action has the following input parameters:


name Description
Ticks
Specifies the system ticks of the date and time.

Allowed Context Scopes
[Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum] 
Format
Specify the format of the date and/or time.

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

Information The date format changes depending on the selected country language.
Warning The action gets the system ticks if the format for either date or time is not specified.
[-] 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

Results:

The action returns the following results:


name
description
Ticks Contains the system ticks of 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 day of the week.
Day of the Year Contains the current day of the year.

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.

Warning

If time format is not specified, values for the Hour, Minute, Second, and Millisecond will be equal to zero (0).

An exception occurs when the number of ticks is set as a negative value. Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.

Example 1 (Shows the converted tick value to a date and time):

This example converts the number of ticks to its date and time equivalent for the local TickValue variable with Text as data type. The result of the Date/Time is then output via Write Text.

See other time operations:

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