-
Notifications
You must be signed in to change notification settings - Fork 952
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
Cannot distinguish a date from a date with explicitly written time in an excel file. #543
Comments
The only consistently available information in Excel in addition to the datetime is the format. You can probably figure out the information you want by inspecting the format specification for the cell. See GetNumberFormatString. |
Works like a charm, thank you! |
I'm sorry for re-opening this, but am I doing something wrong on my part, because it seems number format is returning the incorrect date format for a supplied date? In the excel, I have the date Shouldn't it return instead |
Linked to #461 |
The library does an excellent job parsing dates to
DateTime
objects, but in doing so makes it impossible to distinguish if the cell originally contained the valuedd/mm/YYYY
instead ofdd/mm/YYYY hh:mm:ss tt
.I feel like this is important for cases where you need to verify a date against a specific format, as the above would ruin the validation if you expect a format without time, as the date you receive will always be with a time. (
DateTime
objects without time set, default to the time of 12:00:00 AM)Are there any possible solution to this, other than wrapping the
DateTime
object the library produces in a custom type that could help alleviate these differences, as changing the returned object would undoubtedly be a breaking change for many current users of the API?The text was updated successfully, but these errors were encountered: