I'm trying to convert text to a datetime field for a date comparison however I keep getting this error "The provided text value can't be converted into a valid datetime." I've posted my Subflow text below.
I'm getting a date from a web browser SSL certificate(The Valid From and Valid To fields on the certificate) and this is the format I'm grabbing.
Wednesday, October 19, 2022 3:49:37 PM
When I try to convert it to a datetime field using a custom format(dddd, MMMM dd, yyyy hh:mm:ss tt) I'm getting errors. I've tried all sorts of things to get this to work but haven't been able to do so. At one point I just tried hard coding the date so I wasn't messing around with variables and I swear I had it working with the hard coded value. However when I try to do it again, I'm not having any luck. Really stumped on this one.
FUNCTION Subflow_1 GLOBAL
SET NewVar TO $'''Wednesday, October 19, 2022 3:49:37 PM'''
Text.ConvertTextToDateTime.ToDateTimeCustomFormat Text: NewVar CustomFormat: $'''dddd, MMMM dd, yyyy hh:mm:ss tt''' DateTime=> TextAsDateTime
Display.ShowMessageDialog.ShowMessage Title: $'''Converted Date''' Message: TextAsDateTime Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
END FUNCTION