Set System Time Action Icon

Set Date and Time

 

Declaration

<AMSETSYSTEMTIME SERVER="text (server name)" />

See Also

Change Printer | Display | Empty Recycle Bin | End Process | Get Process Information | Get Volume Information | Log Event | Print | Registry | Run

Description

Sets the system clock to the date and time referenced by a specific Internet time server (a dedicated time server that distributes accurate time) or sets the system clock to the date and time specified.

Practical Usage

Often used to set the system date and time to an accurate value. Also a practical way to synchronize the date and time in a multi-machine environment.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Set to Internet time server

Text

No

(Empty)

null

Sets the date and time using the Internet time server.

Use a specific time server

Text

No

time.chu.nrc.ca

SERVER="tick.ucla.edu"

If enabled, provides a list of time servers to select from. The available options are:

  • time.chu.nrc.ca

  • time.nrc.ca

  • navobs1.usnogps.navy.mil

  • navobs2.usnogps.navy.mil

  • tick.ucla.edu

  • tock.ucla.edu

  • time-a.nist.gov

  • time-b.nist.gov

Port

Number

No

123

PORT="142"

The Internet port to use. The default port is 123.

Set to specific date and time

Text

No

(Current)

SETTIME="%DateSerial(2010,08,04) + TimeSerial(08,09,30)%"

If enabled, allows you to set a specific date and time.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Sample 1 - Use specific time server to set date and time.

 

<AMSETSYSTEMTIME SERVER="navobs2.usnogps.navy.mil" />

 

 

Sample 2 - Set to a specific date and time.

 

<AMSETSYSTEMTIME SETTIME="%DateSerial(2010,12,25) + TimeSerial(00,00,00)%" />

 

↑ Top of Page