My input string is "Wed, Sep 27, 2017".
I am expecting output as 27-09-2017.
So you have an input string of (simplified) "text text numbercomma number".
Your format string tells ScanFromString to look for "numberminusnumberminusnumber".
Which result do you expect from such a format string with this input? (And why don't you implement some error handling?)
To have your expected value is not possible with only this function because we use "Scan from string" when we know the exact format of the input.
And the input "format string" of the function "scan form string" is not the format that you would expected to have but the format of the input string.And your error is because the "format string" don't matches with your input. change it in the correct form and the results will permit you to have your expected value
Kudos are welcome
Building on the 2 previous replies, the format string pattern needs to match the input string. And I think there is a misunderstanding of which data type you need the output to be (either timestamp or string). Here's a quick example that extracts the timestamp output and then converts it to a string in the format you've specified:
EDIT: Added timestamp conversion to string output