Hi all, I'm a new BP user and have a issue here where I'm trying to use C# code in BP to check to see if a date is valid.
My code is
DateTime dateTime;
string mydate = Year + Month + Day;
validDate = (DateTime.TryParseExact(mydate, "yyyyMMdd",
CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime));
I pass the Year; Month and Day as inputs from values already held in a data object as text.
My output is a flag called valid date.
When I run the code with month, day and date passed in with the value in the data object it is not working. (see image below)
However when I pass it in with hard coded values in quotes - the code works perfectly. i.e "11" "11" "2018"
Could anyone advise what I'm doing wrong?
View attachment Capture.PNG
My code is
DateTime dateTime;
string mydate = Year + Month + Day;
validDate = (DateTime.TryParseExact(mydate, "yyyyMMdd",
CultureInfo.InvariantCulture, DateTimeStyles.None, out dateTime));
I pass the Year; Month and Day as inputs from values already held in a data object as text.
My output is a flag called valid date.
When I run the code with month, day and date passed in with the value in the data object it is not working. (see image below)
However when I pass it in with hard coded values in quotes - the code works perfectly. i.e "11" "11" "2018"
Could anyone advise what I'm doing wrong?
View attachment Capture.PNG