Hello,
Is there any way to convert strings to date objects? I am working with a string like 20170920 and I would like to convert that to a date for manipulation. Is there any way to achieve this in a GAMFT project?
Thanks!
Grodaes
Convert Strings to Dates
Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
- Support_Andy Offline
- Posts: 8
- Joined: Thu Feb 16, 2017 11:03 am
Re: Convert Strings to Dates
To convert a string variable to a date object and modify that final date, the following steps can be used.
In this example the variable with a string of '20170920' is called ${varstring}
Finally the ${adjusttime} variable can be used in any subsequent tasks that need an adjusted time variable
In the sample shown the ${adjusttime} variable value = '07-23-2017'
In this example the variable with a string of '20170920' is called ${varstring}
- Using the Set Variable task and assigning a Variable Name of "varnew"
value = ${ReformatDateTime(varstring, 'yyyyMMdd', 'MM-dd-YYYY')}
- Using another Set Variable task and assigning a Variable Name of "adjusttime"
value = ${AdjustDateTime(varnew, 'MM-dd-yyyy', 'days', -60)}
Finally the ${adjusttime} variable can be used in any subsequent tasks that need an adjusted time variable
In the sample shown the ${adjusttime} variable value = '07-23-2017'