Format

The Format component is used to format date & time according to a formatting pattern you specify.

Screenshot

Supported Functions

Double Click on the Format component title bar to open Format window.
In the Format window you can change the date-format.

Screenshot

Ports

The Format component exposes the Control In, Control Out, Data In, and Data Out ports by default.

Port Description
ControlIn Must be connected to the Control Out port of one or more components.
ControlOut Can be connected to the Control In port of another component or the default end component.
Data In The Compare component exposes the following Data In ports:
DateObject (DateTime): specifies the first date or instance to format.
Data Out Returns a desired result post the format.

Properties

To edit the properties of the Compare component, in the Properties window, change the required property. You can edit the following properties.

Property Description
Search Search for the respective property.
Delay After Execution Specifies the wait time (in seconds) after the action is performed.
Delay Before Execution Specifies the wait time (in seconds) before the action is performed.
Format Description to use
Date dd In small Case
Month MM upper case
Year yyyy small case
Hours HH small case
Minutes mm small case
Seconds ss small case

Example

Let us consider an example of comparing two dates

Screenshot

To Format the date and time:

  1. In the Toolbox, expand Utilities and then expand DateTime.
  2. Drag the Now component and drop it on the Design surface.
  3. In the Toolbox, expand Utilities and then expand DateTime.
  4. Drag the DateTime component and drop it on the Design surface.
  5. Double-click the Format component title bar and enter the desired Date or Time format.

    Screenshot

    Note

    You can override the existing data source for both the DateObject and FormatString Data In ports.
    To override the existing data source:

    • Right-click the required Data In port.
    • Click Override and change the data source.
      To learn more about overriding the data source of the data port, refer the Override section.

  6. To enable display of the returned value, you can add a Message Box component to the activity.

    To add the MessageBox component:

    • In the Toolbox, expand General.
    • Expand the MessageBox component, drag the Show component and drop it on the Design surface.
  7. Connect the control ports and data ports in the activity.
  8. In the toolbar, click Run.
    The messagebox displays a value, based on whether the dates are the same or if the first date is before or after the second date

    Screenshot