How to display date in excel via Export from Javascript based on Regional Settings?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Abdul Qadir
    New Member
    • Dec 2010
    • 2

    #1

    How to display date in excel via Export from Javascript based on Regional Settings?

    Hi,
    I am using Javascript for Excel Export from classic ASP.
    In my excel i have many Date columns that i need to store based on the regional settings.
    The application also allow us to set the dates in a format but this should be overridden with the regional Settings for the date.
    I have used toLocaleString( ) to convert the dates but for dd/mm/yyyy if i have some dates like 04/12/2010 its converting that to 12/4/2010 not happening for all but especially for this. Could anyone please provide me the code that will convert the date to regional settings regardless of how they are coming from the application?
    Thanks...
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    I think you have to set the NumberFormat property to the required format. Does that work?

    Comment

    • Abdul Qadir
      New Member
      • Dec 2010
      • 2

      #3
      Hi Mate,
      Actually i need to set the NumberFormat property to the regional settings i am choosing.
      How can i get the regional setting Format for the date so that i can feed that to the number format property so that the application always takes that format and put the dates properly in Excel?
      If you could share the code for getting the regional date and the same could be used for the NumberFormat property i guess that will help.
      Please let me know your inputs.
      Thanks...
      Best Regards
      AB

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Try the Application.Int ernational property.

        Comment

        Working...