Format Date Time Action
<AMTEXTFORMATDATETIME DATETIMEFORMAT="text" INCLUDEAMPM="yes/no" RETURNRESULT="text" ACTION="text" SPECIFIEDDATETIME="text" SPECIFIEDFORMAT="text" SPECIFIED12HOUR="yes/no" INCLUDEAMPM="yes/no" ADJUSTYEAR="number" ADJUSTMONTH="number" ADJUSTDAY="number" ADJUSTHOUR="number" ADJUSTMINUTE="number" ADJUSTSECOND="number">
Converts a date and/or time into the specified format.
Date and text manipulation. Used to modify a date value to so that it matches a required format. For example, the application being automated may require a date to be input in a specific format such as yyyy dd mm - this action would be used to modify the value accordingly.
Specifies the format that should be used when the date is output.
The following special characters are used to create a date format:
y = year
m = month
d = day
h = hour
n = minute
s = second
hh = leading zero (03)
h = no leading zero (3)
Must specify an already existing variable name to be populated with the formatted date.
Specifies whether hours of the day will be based on a 12 or 24 hour clock.
Specifies whether an AM or PM indicator should be added to the end of the formatted date time value. This option is only available when "12 hour format" is specified.
Specifies the source of the date time value to be formatted. .
The available options are:
current: The current date time will be used
specified: the specified date time will be used
run time a dialog will be presented which will prompt the user to select
Specifies the date time to format when Action is set to "specified".
Specifies the format that should be applied when attempting to read the date in "Specified Date Time".
Specifies the message that should be used on the date an/or time prompt dialog box.
Specifies whether the prompt dialog box should prompt for the date, the time, or both.
The available options are:
datetime: The user will be prompted for the date and the time
time: The user will be prompted for the time
date: The user will be prompted for the date
Specifies the number of years the date should be adjusted by. A positive or negative number may be used.
Specifies the number of hours the date should be adjusted by. A positive or negative number may be used.
Specifies the number of months the date should be adjusted by. A positive or negative number may be used.
Specifies the number of minutes the date should be adjusted by. A positive or negative number may be used.
Specifies the number of days the date should be adjusted by. A positive or negative number may be used.
Specifies the number of seconds the date should be adjusted by. A positive or negative number may be used.
All variables must be created before they can be used. This is done using the Create Variable <AMVARIABLE> action. Once created, variables can be set using the Set Variable <AMSET> action, or by certain actions that support populating variables. To get data out of the variables, in any action parameter, simply surround the variable name with percentage % signs (e.g. %varname%). Remember not to use percentage signs when specifying the name of a variable to populate, percentage signs are only needed to get data out.
This action includes the Description tab for entering a custom step description.
More on setting custom step description
This action also includes the standard Error Causes and On Error failure handling options/tabs.
More on Error Handling Options
All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.
More on variables
More on expressions
More on the expression builder
NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.
<AMTEXTFORMATDATETIME DATETIMEFORMAT="m/d/yyyy" 12HOURFORMAT="NO" RETURNRESULT="thedate" ADJUSTDAY="-1">
<AMMESSAGEBOX>yesterdays date was %thedate%</AMMESSAGEBOX>