Skip to main content Skip to complementary content

Converting a string to a date

Convert a String data type to a Date/Time type with a specific format.

Procedure

  1. In the readings_output structure, click the Timestamp element and select Date/Time in the Data Type field. Do this for every occurrence of the Timestamp element in the structure.
  2. Save the structure and open readings_map.
  3. Select the three Timestamp elements, right-click them and click Remove Expressions (Mappings).
  4. In the Functions tab of the left panel, select the ParseDateTime function and drag and drop it on one of the Timestamp elements in the output structure.
  5. Select the Timestamp element in the input structure and drag and drop it on the Value argument under the ParseDateTime function.
  6. Double-click the ParseDateTime function to open its properties and enter the pattern for your date, M/D/Y h:m a for example, then click OK.

    Example

  7. Right-click the ParseDateTime function and click Copy, then paste it in the Value tab of the other two Timestamp elements in the output structure.
  8. Press Ctrl + S to save the map.

Results

Your map is now configured to convert strings into meaningful data types.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!