Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6829331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:29:16+00:00 2026-05-26T22:29:16+00:00

Many StackOverflow posts and other online forums have questions similar to this, but none

  • 0

Many StackOverflow posts and other online forums have questions similar to this, but none of them really resolve the issue I’m having.

I’m exporting an XML file from Excel. The Excel file contains dates. In the XML file, however, those dates show up as integers–the date is made to be the nth day since 1/0/1900, I believe.

I’m using JavaScript to extract the data from the XML file to populate a table in a web page.

I suspect that a solution could come in two different forms:
1. A way to convert, in JavaScript, the integer to the date it represents.
2. A way to force the XML file to take a formatted date from the Excel file.

I’m clearly a novice with XML and JavaScript, so your assistance would be sincerely appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:29:17+00:00Added an answer on May 26, 2026 at 10:29 pm

    The format Excel uses for the xml-export depends on the added XML-schema. This can be explicitly created and added or — as I suspect in your case — has been implicitly/ automatically generated by Excel.

    In my example I have two colums, the first one has via XML-Schema to format date-time, the second is normal text and only for the representation in Excel (column format) a date.

    Screenshot of an excel-sheet with two columns both containing dates

    When I export this as XML I get two seemingly completely different results:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <dataroot>
        <Tabelle11>
            <Title_1>2009-10-12T00:00:00.000</Title_1>
            <Title_2>40098</Title_2>
        </Tabelle11>
        <Tabelle11>
            <Title_1>2000-01-01T00:00:00.000</Title_1>
            <Title_2>36526</Title_2>
        </Tabelle11>
    </dataroot>
    

    When I check the XML-Schema (e.g. with “Debug.Print ActiveWorkbook.XmlMaps(1).Schemas(1).XML”) I see the difference (only snippet, not the complete file):

    <xsd:element name="Title_1" minOccurs="0" od:jetType="datetime" od:sqlSType="datetime" type="xsd:dateTime">
        <xsd:annotation>
            <xsd:appinfo>
                <od:fieldProperty name="Format" type="10" value="dd.mm.yyyy"/>
            </xsd:appinfo>
        </xsd:annotation>
    </xsd:element>
    <xsd:element name="Title_2" minOccurs="0" od:jetType="text" od:sqlSType="nvarchar">
        <xsd:annotation>
            <xsd:appinfo>
                <od:fieldProperty name="Format" type="10" value="@"/>
            </xsd:appinfo>
        </xsd:annotation>
        <xsd:simpleType>
            <xsd:restriction base="xsd:string">
                <xsd:maxLength value="255"/>
            </xsd:restriction>
        </xsd:simpleType>
    </xsd:element>
    

    The first column is in the schema of format datetime, the second is varchar. Again, you might not even be aware, how Excel handles your XML-data, since this schema is automatically generated (if I recall correctly in Excel 2003 there was a message indicating that an schema had benn generated for you)

    Now how to acomplish this — especially in an existing file: I would try to extract the XML-Schema (see above), save it as something.xsd, adapt the schema according to your needs and import this new Schema. Bummer is you have to set the mapping again (or try this: Excel 2007 XML Source Maps – Refreshing Schemas). Often I let MS Access generate my XML-Schema, i.e. generate the required table, insert some values and exprt the table as XML (ticking the option to add the schema).

    I hope this general outline gives you an idea on how to proceed.

    Regards

    Andreas

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There seem to be many questions asked about this subject here on stackoverflow, but
I know that there are many posts about this on Stackoverflow, but this one
After looking at stackoverflow and many other forums, decided to ask this question. The
I've read this: https://stackoverflow.com/questions/631850/how-do-you-name-your-many-to-many-relationship-tables But my question is a little different. I'm just wondering
I have seen many answers on stackoverflow, but I didn't find an answer that
while surfing through the web and through stackoverflow.com i found many posts in forums,
Many posts around about restoring a WinForm position and size. Examples: www.stackoverflow.com/questions/92540/save-and-restore-form-position-and-size www.codeproject.com/KB/dialog/restoreposition.aspx?fid=1249382&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2595746 But
I wanted to present a semi-transparent modal view. From many other stackoverflow posts, (eg
Okay, I've read a number of other posts on StackOverflow regarding multi-threading, but I
OK I have read many posts regarding Dual Licensing using MIT and GPL licenses.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.