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
parser doesn't seem to properly parse exif formatted datetime #101
Comments
Well, the thing is the string is not really standard (the >>> from dateutil.parser import parse
>>> parse('2016:12:26 15:45:28')
datetime.datetime(2017, 3, 16, 15, 45, 28) To make it work you have to use >>> import pendulum
>>> pendulum.from_format('2016:12:26 15:45:28', '%Y:%m:%d %H:%M:%S')
# <Pendulum [2016-12-26T15:45:28+00:00]> |
Roger. I agree it's an odd format, but to the degree that If so, I can work on a pull request. |
I'm +1 on this having dealt with EXIF data in the past. |
Per [jMyles](sdispater#101) this adds a test in pytest format with a single example
+1 on the issue as well. implemented a unit test for the single case presented above, and a slight modification to the COMMON regex used in the parser for YYYY:MM:DD separators. from_format does look to be the appropriate parse option though fwiw. PR this? |
Implemented changes to regex parser for common date formats to include semicolon dates separated by YYYY:MM:DD per [Issue 101](sdispater#101) Signed-off-by: Evan Mattiza <emattiza@gmail.com>
Per [jMyles](sdispater#101) this adds a test in pytest format with a single example. Alters COMMON regex to include : as date-separator Signed-off-by: Evan Mattiza <emattiza@gmail.com>
Per [jMyles](#101) this adds a test in pytest format with a single example. Alters COMMON regex to include : as date-separator Signed-off-by: Evan Mattiza <emattiza@gmail.com>
Version |
Hey there. Thanks for pendulum.
It seems that pendulum.parse() does the wrong thing for strings gleaned by PIL's ExifTags interface.
For example, on a Canon S-series camera, the string for the key 'DateTime" is:
'2016:12:26 15:45:28'
By pendulum parses this into this Pendulum object:
2017-03-16T11:21:27+00:00
The text was updated successfully, but these errors were encountered: