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

doesn't correctly handle dates without time zones #8

Open
rothskeller opened this issue Jun 18, 2021 · 0 comments
Open

doesn't correctly handle dates without time zones #8

rothskeller opened this issue Jun 18, 2021 · 0 comments

Comments

@rothskeller
Copy link

According to the XMP Specification, Part I, section 8.2.1.2, "the time zone designator need not be present in XMP. When not present, the time zone is unknown, and an XMP processor should not assume anything about the missing time zone."

The go-xmp library parses time fields (e.g. xmp:CreateDate) using the Go time.Parse function, which assumes UTC if it doesn't see a time zone. More fundamentally, the library stores time fields in a Go time.Time structure, which has no way to represent a time without a time zone. There's no way for a library user to tell that the time zone is unknown. As a result, a photo viewer could be showing a "local" time that is many hours off from the correct one.

Since XMP times cannot be faithfully represented in a Go time.Time, it would be best to leave them in string form, and provide the conversion routines as separate functions.

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

1 participant