Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4341
Excel cell date format based on regional settings
posted

Hello Support,

We are using Infragistics Excel engine to read and write the values from Excel. We want to write a date values in the a specific column with the date format as set in the regional settings. Also we want that when reading the date values from these columns, the values should be read in the format set in the regional settings on the machine. However, we found that the dates values are not read correctly when read from different machine having different regional settings. FOr e.g. suppose from a machine having regional setting set to "English (New Zeland)" with the date format as "mm/dd/yyyy", when we open the excel file from a machine having regional settings as "English (United States)" with date format as "dd/mm/yyyy", some of the date values are not read correctly. We wanted to know is there any property in the Infragstics Excel Engine so that when writing to excel we can set cell format to default date (* format) or set the "locale" of the cell. And later when we open and read the excel file it would pick up and read the dates in the format set on the machine?

  • 44743
    posted

    We try to mimic MS Excel behavior whenever possible in the Excel engine. When using a date format such as "mm/dd/yyyy", MS Excel does not reorder the format sections based on culture, so we do not either. They do however, reorder it when using a date format such as "m/d/yyyy", and we honor this behavior as well, so use this format instead.