Convert String To Date
Component definition
The Convert String to Date component evaluates a text string. If the data is valid (can be converted to a date), the Convert String to Date component converts the text string to the date-time format specified. By default, the format for date-time conversion is MM/DD/YYYY HH:MM:SS (month, day, year, hour, minute, second). You can alter the format to meet your needs. The format must be an accepted date-time format from the Microsoft .NET Framework Class Library. This library is linked to in the component's Help screen.
Component icon
Description of component output paths
Unknown
The component output paths are described in the following table:
Property |
Description |
Unknown
|
Unknown
|
Unknown
|
Unknown
|
Description of component tabs and their properties
The properties on the Convert tab in the Convert String To Date component are listed and described in the following table:
The properties on the Formatting tab in the Convert String To Date component are listed and described in the following table:
The properties on the Settings tab in the Convert String To Date component are listed and described in the following table:
Connection information
Not applicable
Component settings
Unknown
Use cases
An example for the Convert String To Date component is as follows:
Database switch
Scenario: The HR department needs a new database for employee records. The old database stored the dates as strings (for example, March 13, 1998). The new HR database stores dates as true date-time data types. Therefore, the string dates need to be converted before their insertion into the new database.
Process: This process is built in a Workflow project.
The following screen shot shows the process:
The process begins with a custom component that obtains the set of employee records, each having a string format HireDate value. The record set is sent to the For Each Element in Collection component. It then delivers the records one at a time to the Convert String to Date component.
The Convert String to Date component takes in the variable CollectionOfEmployees.HireDate and converts its value to the format that is specified on the Formatting tab. For this example, the format MM-DD-YYYY is used.
The following screen shot shows the Convert String to Date editor:
You can leave the Exact Datetime Format box empty. If you leave it blank, the component uses MM/DD/YYYY HH:MM:SS as the default format.
After each record's date format converted, the For Each Element in Collection component delivers the updated record to the custom InsertRecordsInNewDB component. The custom InsertRecordsInNewDB component inserts the record into the new database.
Other components in this example are as follows:
-
Custom component
This component was created with the integration engine.
For more information on the integration engine, see the Workflow Solution Administrator's guide.
www.altiris.com/support/documentation.aspx
Form Builder
Send Email