Skip to content
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

Incorrect dates with numfmt h:mm AM/PM #8

Closed
stla opened this issue Feb 13, 2017 · 4 comments
Closed

Incorrect dates with numfmt h:mm AM/PM #8

stla opened this issue Feb 13, 2017 · 4 comments

Comments

@stla
Copy link

stla commented Feb 13, 2017

Hello,

The xlsx file is the same as tidyverse/readxl#264

> y <- tidy_xlsx("test02.xlsx", sheet=1)
> y$data$Sheet1
  address row col content formula formula_type formula_ref formula_group
1      A1   1   1       0    <NA>         <NA>        <NA>            NA
2      A2   2   1       1    <NA>         <NA>        <NA>            NA
3      A3   3   1     1.5    <NA>         <NA>        <NA>            NA
4      A4   4   1     1.8    <NA>         <NA>        <NA>            NA
  type data_type error logical numeric                date character
1    s character  <NA>      NA      NA                <NA>         A
2    n      date  <NA>      NA      NA 1904-01-02 00:00:00      <NA>
3    n      date  <NA>      NA      NA 1904-01-02 12:00:00      <NA>
4    n      date  <NA>      NA      NA 1904-01-02 19:12:00      <NA>
  comment height width style_format local_format_id
1    <NA>     15  8.38       Normal               1
2    <NA>     15  8.38       Normal               2
3    <NA>     15  8.38       Normal               2
4    <NA>     15  8.38       Normal               2
@nacnudus
Copy link
Owner

This is a famous bug in Excel.

There should have been a warning from tidy_xlsx(), and it should have parsed the date using the 1904 system, but it was misreading the file because openxlsx uses the date1904 tag differently from my copy of Excel. I have fixed this in 6e1da16.

Please can you try it?

@stla
Copy link
Author

stla commented Feb 13, 2017

Could you give me the command to install this specific commit ?
I don't remember it. And also, last time I installed a package from a specific commit, the installation failed, I didn't understand why. But I can try.

@nacnudus
Copy link
Owner

It is in the master branch, so you can use devtools::install_github("nacnudus/tidyxl") as normal.

@stla
Copy link
Author

stla commented Feb 17, 2017

Done. Now I get the same dates as readxl. I think I can close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants