New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moment in and require ('node-xlsx') with the use of a problem #2930
Comments
There is only one date format in the document, then there is no problem to deal with, if more than one column, then all the dates are treated as 1970-01-01 |
Try |
Also note JavaScript is case sensitive. Please post the real code, with the real example value. Thanks. |
code: console.log("~~~~~~~"+param[1]+"~~~~~~~"+moment(param[1]).format('YYYY-MM-DD')) console: server-0 [2016-02-03 15:41:07.729] [INFO] console - ~~~~~~~41459~~~~~~~1970-01-01 xlsx: fail if xlsx: |
Is this still an issue? |
Yes, it's still a issue. |
Sorry for the delayed response. Missed my inbox somehow. Since your values ( moment.fromOADate(41459) Though if you're only ever working with whole dates, it may be reasonable enough to use: moment('1899-12-30').add(41459, 'days') |
I use require ('node-xlsx') to read the xlsx file, the file contains the date, and now the problem is:
If xlsx document as a whole there is only a date column, then parsed using moment no problem, if the document inside more than two columns, then all dates are resolved to 1970-01-01 format, I would like to ask is what causes?
For example:
2015/12/1 2015/12/1
Moment (param[0]).Format ('YYYY-MM-DD') parameter param[1] for the acquisition of the cell date
If the entire document is only one column, then no problem
If used again
Moment (param[1]).Format ('YYYY-MM-DD') on the emergence of 1970-01-01 as
The text was updated successfully, but these errors were encountered: