Date and Time Configurations

The Automation1 controller lets you get and set its date, time, and time zone.

On PC-based controllers:

  • To get the date and time information, you can use the AeroScript DateTime Functions or Automation1 Console commands.
  • To set the date and time information, you must use the standard Windows menus.

On Drive-based controllers:

  • To get the date and time information, you can use the AeroScript DateTime Functions or Automation1 Console commands.
  • To set the date and time information for the system clock, Aerotech recommends that you use Machine Setup in Automation1 Studio. See the Controller milestone for more information. As an alternative, you can set the date and time of the system clock by using the Automation1 Console commands. Refer to the information that follows to learn more about these commands.

Getting the Controller Date and Time

To get the date and time of a controller, use the datetime get Console command as follows:

datetime get

This command returns a date and time string in the sequence of:

[DayOfWeek] [YYYY-MM-DD] [HH:MM:SS] [TimeZone]

Table: datetime get Console Command Arguments

Argument Description

[DayOfWeek]

The name of the day of the week.

[YYYY-MM-DD]

The current year, month, and day. The values are zero-padded to match this format.

[HH:MM:SS]

The current time with zero-padded values.

[TimeZone]

The name of the time zone that applies to your current location.

IMPORTANT: The names of time zones are different between the PC and Drive-based controllers.

To find the time zones that apply to your controllers:

Setting the Controller Date and Time

To set the date and time for a drive-based controller, Aerotech recommends that you use Machine Setup in Automation1 Studio as an alternative to the Automation1 Console commands. See the Controller milestone on the Machine Setup page for more information.

WARNING: Use the datetime set Console command with drive-based controllers only. If you try to use it while you are connected to a PC-based controller, the command will return an error. To set the date and time for a PC-based controller, you must use the standard Windows menus.

You can use the datetime set Automation1 Console command to change the date and time on the system clock of your drive-based controller. Refer to the information that follows:

datetime set dateString timeString [timeZone]

Specify values for the controller date and time arguments that follow:

Table: datetime set Console Command Arguments (Positionals)

Argument Description

dateString

Required text argument. The date to set as a string in the form of YYYY-MM-DD. The year must be a four-digit year. The month is one-based with January as month 1. The day is also one-based.

timeString

Required text argument. The time to set as a string in the form of HH:MM:SS. You must specify the time in 24-hour format.

[timeZone]

Optional text argument. The name of the time zone for the time that you set. If you do not specify a time zone, the time zone on the controller does not change. If you specify an invalid time zone name for this argument, the drive-based controller returns an error. For information about all the valid time zone names for drive-based controllers, see the Time Zones for Drive-Based Controllers section of this page.

Time Zones for Drive-Based Controllers

You can set two types of time zones - ones that adjust for Daylight Savings Time and ones that do not.

IMPORTANT: When you use the datetime set Console command, you must supply the time zone name exactly as it appears in the table.