XenoGuard Documentation

Set Time Information

Actions » Windows » File » Set Time Information 

The action Set Time Information sets the file's creation time, last write time, and last access time.

[-] Hide
  1. Open the Windows node in the Workspace Explorer.
  2. Open the File node, and select the Set Time Information action.

Parameters:

The action has the following input parameters:


name Description
Path Name
The path name of the file to set the time information.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Date/Time Format
Specifies the date and time format of the file.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Creation Time
Specifies the date/time a file was created.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Last Write Time
Specifies the date/time a file was updated.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter, Enum]
Last Access Time
Specifies the date/time a file was last accessed.

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.
Warning The value of the Date/Time Format applies to Creation Time, Last Write Time, and Last Access Time. If the value of the latter parameters does not match the format, an error occurs during the execution.  

Results:

The action returns the following results:


name
description
Creation Time
Shows the date/time the file was created.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter]
Last Write Time
Shows the date/time the file was updated.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Types [Variable, Parameter]
Last Access Time
Shows the last accessed date/time of the file.

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

Example 1 (Update file information when changes are made):

This example stores the path of a text file in a local variable named User License with Text as data type. The content of the file was updated by replacing some of its contents. The action in the "Then" branch is executed when the Number of Replacements is greater than zero which includes the updating of the Last Write Time and Last Access Time and displays and output via Message Box, otherwise, the action in the "Else" branch is executed.


See other file operations: