Format Mail Time Stamp to DateTime Format

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

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:

@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

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

image

1 Like

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:

1 Like

Thanks all for response and help :slight_smile:

Rgds
Aditi