Source and Data type | Target and Data type | To Convert Dates |
---|---|---|
Pre-structured Data type is "Date" | Pre-structured Data type is "Date" | Maps usually convert dates to the correct format in the target file automatically. If not, re-format the date. |
Delimited ASCII Data type is "Text" | Pre-structured Data type is "Date" | Write a target field expression using the DateValMask Function. |
Binary, Fixed ASCII, or Record Manager | Pre-structured | Write a target field expression to re-format the date in your target date field. |
Any type | Binary, Fixed ASCII, or Record Manager | Write a target field expression to re-format the date in your target date field. |
Source Format | Target Format | Expression Example |
---|---|---|
Text field dd-mon-yy mm/dd/yy | Text field 05-Jul-99 05/07/99 | DateConvert("dd-mon-yy ", "mm/dd/yy", FieldAt("/SOURCE/R1/Field1")) |
Two Text fields, one date, the other time: Field1: 09/15/99 Field2: 14:37:09 | SQL Server DateTime fields Field1: 09/15/99 Field2: 14:37:09 | DateValMask(FieldAt("/SOURCE/R1/Field1") & (FieldAt("/SOURCE/R1/Field1")), "mm/dd/yyH24:MM:SS") |
Date Field from SQL Server table | To Binary Packed decimal | No date conversion expression is necessary. Using the default expression, a target field is converted to the date value as a packed decimal. |
dBASE Date field yyyymmdd 19980122 | Text field mm/dd/yy 01/22/98 | DateConvert("yyyymmdd", "mm/dd/yy", FieldAt("/SOURCE/R1/Field1")) |
PSQL DateTime mm/dd/yyyy HH:MM:SS Am | Salesforce DateTime YYYY-MM-DDTH24:MM:SS.000Z | Dim DateArray(2) DateArray = Split(FieldAt("/SOURCE/R1/Field1"), " ") DateConvert("m/d/yyyy", "yyyy-mm-dd", DateArray(0)) & "T" & TimeValue(DateArray(1) & " " & DateArray(2)) & ".000Z" |
Salesforce DateTime YYYY-MM-DDTH24:MM:SS.000Z | PSQL DateTime mm/dd/yyyy HH:MM:SS Am | Dim inputDate inputDate = DateValMask(StrReplace("Z", "", FieldAt("/SOURCE/R1/Field1")), "yyyy-mm-ddTH24:MM:SS.TT3") Format(inputDate, "yyyy-m-d hh:mm:ss") |
Text field mm/dd/yy | Text field mm/dd/yyyy | If Right(FieldAt("/SOURCE/R1/Field1"), 2) >= 50 Then Left(FieldAt("/SOURCE/R1/Field1"), 6) & "19" & Right(FieldAt("/SOURCE/R1/Field1"), 2) Else Left(FieldAt("/SOURCE/R1/Field1"), 6) & "20" & Right(FieldAt("/SOURCE/R1/Field1"), 2) End if |