Hello guys!! good morning!
I’m struggling with ParseExact right now and I can’t resolve it.
"DateTime.ParseExact(item.Headers(“Date”).ToString, “MM/dd/yyyy HH:mm:ss”, System.Globalization.CultureInfo.InvariantCulture).ToString(“yyyyMMdd_HHmmss”)
"
The main idea is to download attachments from the emails and place them into folder renamed with the current date and time
like:
I’m from Portugal, any idea how to solve this?
Thank you in advance.
ppr
(Peter)
June 21, 2021, 10:23am
2
Patterns are not matching
Please provide us a sample of the date string which is sent to ParseExact or is it this Mon, 21 Jun… String
Hi,
The format you mentioned should match the actual value(item.Headers(“Date”).Tostring)
I changed that already, doesn’t work
"DateTime.ParseExact(item.Headers(“Date”).ToString, “dd/MM/yyyy HH:mm:ss”,
System.Globalization.CultureInfo.InvariantCulture).ToString(“ddMMyyyy_HHmmss”)
"
Hi ,
Not that !!!
The string you have “Mon, 21 Jun 2021 09:55:22 +0100” is not in the format that you mentioned to parse(“MM/dd/yyyy HH:mm:ss”,). The formats of those should match.
Do the below ,
From the string “Mon, 21 Jun 2021 09:55:22 +0100” try to extract “21 Jun 2021 09:55:22” using String Manipulations and then use parser with format dd MMM yyyy HH:mm:ss
Hope it works !!!
Hello, yes it is Mon, 21 Jun … you have two screenshots up there buddy. One from message box and the other from a write line
Hello, do you have any examples?. So I can read and learn.
That can be very simple to do, but I never did it before. And it may be tricky
ppr
(Peter)
June 21, 2021, 11:24am
8
it was asked as your used format string was not matching the input format. Have a look below:
2 Likes
Hi there!
That’s worked for me. Thank you
system
(system)
Closed
June 24, 2021, 12:08pm
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.