I need to get a mails list from gmail, I am using “Get IMAP Mail Messages”, from this list of mails I need to catch every mails sended yesterday, for that I am using for each and for every item I am getting the sentence item.Headers(“date”) for know the receive’s date. In other variable type datetime I am catching the actual date “NOW”.
As item.Headers(“date”) is string, I need to convert to date for comparation with now date, here is my issue because the mails have different type of date, for example, some mails come with date like:
“Sat, 25 Jan 2020 03:45:30 -0500”-> this apply Cdate(item.Headers(“date”)) and convert well
“24 Apr 2020 10:42:42 -0500” → this apply Cdate(item.Headers(“date”)) and convert well
but whith next date appear a error “Wed, 06 Nov 2019 16:23:23 +0000 (UTC)” appear this error: Assign: Conversion from string "Wed, 06 Nov 2019 16:23:23 +0000 " to type ‘Date’ is not valid.
Hey Carlos, can you set your input to “Wed, 06 Nov 2019 16:23:23 +0000 (UTC)” and see if it still gives an exception? Or check if it still that date that gives you an error. If not, then your input data is changing and we gotta solve for that.