Select time on email date

email
activities

#1

mail.Headers(“Date”).toString => Fri, 9 Jun 2017 11:52:22 +0200 (CEST)

mail.xxxxxxxx(“xxxxxx”).toString => (only) 11:52:22


#2

You can try this: Convert.ToDateTime(mail.Headers(“Date”)).ToString(“hh:mm:ss”)

Regards…!!
Aksh


#3

String was not recognized as a valid DateTime.


#4

yes what you are using ? you are directly passing it on mail.Headers(“Date”)? it will return string so convert it into datetime then you can use this.


#7

I guess by now this issue must be solved but if not you can try this format : “ddd, d MMM yyyy HH:mm:ss +0200 (CEST)” to convert it into datetime

dateVal = “Fri, 9 Jun 2017 11:52:22 +0200 (CEST)”

DateTime newDateValue = DateTime.ParseExact(dateVal,“ddd, d MMM yyyy HH:mm:ss +0200 (CEST)”,CultureInfo.InvariantCulture)

newDateValue.ToString(“dd.MM.yyyy”)