Email Received Date Format

I have a requirement to append the email received date to the email file name when saving to a folder. It is working fine in my system. Date format is like:

image
Here is my code
image
image

I ran the same .xaml file in my colleague’s system. But the date format in her system is like:
image

It is the same .xaml code running in both our systems. How do I make sure that her date format is same as mine?

firstly, make sure the date format on both computers are the same
image

1 Like

@jack.chan , It is the same for both of us. I have provided the screenshot below.

Mine:
image

Colleague’s
image

What variable type is “email”? is it mailmessage?
image

If it is a mailmessage, you can try mail.Headers(“Date”) instead of email.Date

1 Like

@jack.chan , email is of type mailmessage.
email.Headers(“Date”) also gave the same result as email.Date.
So I converted the date in her code as given below:
Datetime.Parse(email.Headers(“Date”),System.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”)