How to extract only Date from the received email


#1

Hi,

I want to extract only the date from the result of item.Headers(“Date”)
How can we do it?
This is needed as in the flow I am checking a condition of the system date equals the email date in the format mm-dd-yyyy

image


#2

Hi @anshulagarwal,
Check this…

Regards
Balamurugan


#3

I tried but I get the below error message

image

newdatevalue=DateTime.ParseExact(emaildate.ToString,“MM-dd-yyyy hh:mm:ss”,Globalization.CultureInfo.InvariantCulture).ToString(“MM-dd-yyyy”)

newdatevalue is of type string

Thanks,
Anshul


#4

Also, I tried changing the emaildate type to DateTime but in that case it gives the below error message

image


#5

Hi @anshulagarwal,
Check this project.

File :
Extract only Date from the received email.zip (2.0 KB)

Regards
Balamurugan


#6

@balupad14 Thanks this worked :slight_smile: