Format Mail Time Stamp to DateTime Format


#1

Hi All,

I have extracted the time stamp of the outlook mail , I want it in a specific format of date dd-MMM-yyy

When I tried changing as str.ToString(dd-MMM-yyy) exception occurred same happen with Fomat activity as well .

Please help with some solution.

Rgds,
Aditi


Date conversion format
#2

Hi @Aditipatil,

Try this one,
your string value strValue and format is “dd/MM/yyyy” (based on your format give)
DateTime.ParseExact(strValue.ToString(),"dd/MM/yyyy",Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy")

Regards,
Arivu :slight_smile:


#3

@Aditipatil
Try this
first convert to datetime and then convert to string by giving .Tostring(“dd-MMM-yyyy”)

I think there is no format with 3 characters in year, either you can get like yy or yyyy

Regards,
Mahesh


#4

I had similar requirement I did below , check if it works out for you.

image


#5

Hi @hkjobs1988

“dd/MM/yyyy” instead of this you can pass your input string format.
“dd-MMM-yyyy” instead of this you can use what format you want.

Regards,
Arivu :slight_smile:


#6

Thanks all for response and help :slight_smile:

Rgds
Aditi