0

How, i can keep date format same of excel at the time of download in different-2 time zone?

My downloaded file contains date column format is MM-dd-YYYY. The issue is that, while i am downloading the excel file in US region it is not converting the dates into different formats, while i am downloading the same file in UK region, it is converting the dates into dd-MM-YYYY.

Date 12-01-2015 is converting to 01-12-2015.

I want to keep date format of excel file MM-dd-YYYY in all the regions. I am generating the file using ASP.Net C#.

Thanks in advance.

1 Answers1

1

This is because Excel is selecting the different date format based on the program's locale setting. I would imagine your options are:

a: Change the cell format to what you need in each location, e.g. in VBA the code would be something like Selection.NumberFormat = "m/d/yyyy;@"

b: Store your date data in text format. So literally a text string in mm-dd-yyyy format. You could still easily parse it later.

David
  • 1,222
  • 1
  • 8
  • 18