Get the email date and change it's format

Hi everyone!

I’m trying to get the date of the email received from Outlook. I used the item.Headers(“Date”), and here’s the initial format (sample date):

Mon, 26 Apr 2021 09:31:00 +0800

Any suggestion on how can I limit the format to Mon, 26 Apr 2021? I’ll be putting it in the Message Box.

Thank you!

Try item.Headers(“Date”).tostring(“ddd, dd MMM yyyy”)

1 Like

Still has error. Says "Option Strict On disallows implicit conversions from ‘String’ to ‘System.IFormatProvider’

@cldt - Apologize…Try this…i just tested in my code and its working…

Cdate(item.Headers(“Date”)).tostring(“ddd, dd MMM yyyy”)

This works! Thank you so much :grin:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.