Working with Date/Time Format Process

Navigation:  How to Work with Processes > Working with the Date Processes Group >

Working with Date/Time Format Process

Previous pageReturn to chapter overviewNext page

 

Process Purpose

 

The "Date/Time Format" process is used to convert a given date/time into a specific format. The result is stored in a variable.

Check the provided "Date/Time Format" examples at the end of the topic.

 

When you add a process, you are required to define its settings. This occurs in the process's properties window which is displayed automatically after having added the "Date/Time Intervals" process. In this case, the properties window includes 2 tabs - "General" and "Error".

If any subsequent edition is required, double-click the process to open its properties window and enter the necessary modifications.

 

"General" tab

 

 

Proceed as follows:

 

Input

Date

Enter the input value of the date or time that will be formatted OR  click and select a variable with that value. See Variable Usage.

Format

Select an input format from the drop-down OR  enter it with the use of a syntax list that is accessed by clicking .

This format needs to match the format of the date/time value from the "Date" variable value. Ex: For a "Date" time presented like this: 09:50:25, use the following format: %H:%M:%S.

 

The "System Format" option is only available to define a "Date" format (meaning, it does NOT include time values in its format).

Result

Result Variable

Click to define the variable that will receive the result value. See To Select/Create a Variable.

Format

Select the output format for the result from the drop-down OR  enter your own format with the help of a syntax list that is accessed by clicking .

 

The "System Format" option is only available to define a "Date" format (meaning, it does NOT include time values in its format).

 

The use of Millisecond related syntax in a date's format should ONLY be applied when using external date/time information since millisecond info is NOT generated by the MCL-Client.

 

 

Proceed to the "Error" tab.

 

"Error" tab

 

 

Fill in the available option.

 

If Error

Go to

Select a target location from the drop-down or list, in case an error occurs. See Detail of a window below.

 

When defining a screen as a target destination (ex: via a “Go to” process), you CANNOT use variables to specify the name of that target screen. You must select the intended screen from the available drop-down/list.

 

 

 

Detail of a window:

 

 

"S:Menu" is a screen included in the same program as the process.

"R:Routine_1" is a routine included in the same program as the process.

 

If required, use the icon, on the upper right corner of the properties window, to attach any relevant notes to this process.

Click it and enter your notes in the resulting text box. These notes will be displayed in the corresponding "Actions" tab or "Process" window (in the "Notes" field) and in the "Developer Report".

 

After filling in the required options, click to conclude or to abort the operation.

The added process is displayed in the corresponding "Actions" tab or "Process" window.

 

 

If you want to use a label as a target destination, you can use the "Auto-Label" mechanism. This alternative to the "Set Label" process allows you to create a label in the properties window of a process - specifically, in the fields used to define target destinations (ex: the "If Error..." type fields).  See To Automatically Create a Label.

 

 

Use the right-click in MCL-Designer's input boxes to access some related options as well as the general "Cut", "Copy"; "Paste"; "Search" actions (active/inactive according to the current context).

Ex: If you right-click the "Variable" input box (included in a "Conversion's" properties window), you are provided with general editing/search actions and other more specific options such as "Variable Select" (see "Variable Select"); "Variable Insert" (see "Variable Insert"); "Insert Special Character" (see To Insert Special Characters into a Control's Text Input Field) and "Localization Select" (see Localization List).

If you right-click another input box, it may provide other possibilities.

 

 

 

"Date/Time Format" Examples

 

Click Here for Example1 - Input format = Date and Time (DD/MM/YYYY HH:MM:SS) >> output format = Date (YYYY/MM/DD)

 

Click Here for Example 2 - Input format = Date and Time (YYYYMMDDHHMMSS) >> output format = Date (YY/MM/DD)

 

Click Here for Example 3 - Input format = Date (YYYY-MM-DD) and Time  (HH:MM:SS) >> output format = Date (d/m/YYYY HH:MM:SS.MS)

 

Click Here for Example 4 - Input format = Date (DD/M/YY) >> output format = Date (DD/MM/YYYY)