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

date: Implement date methods #5

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Conversation

michaelwright235
Copy link
Contributor

Implement new_date, get_date_val and set_date_val methods.

When creating a date the original library expects one to pass the number of seconds since 01/01/2001 (Mac Epoch). Since it's not obvious and we're quite used to standard Unix Timestamps instead, these methods automatically convert dates to Mac Epoch format (just like the plist Rust library does).

Both set_date_val method and set_random_date test currently panics with an assertion failure due to a libplist bug.

When creating a date the original library expects one to pass the
number of seconds since 01/01/2001 (Mac Epoch). Since it's not
obvious and we're quite used to standart Unix Timestamps instead,
these methods automatically convert dates to Mac Epoch format
(just like the `plist` rust library does).
Both `set_date_val` method and `set_random_date` test
currently panics with an assertion failure due to a
[`libplist` bug](libimobiledevice/libplist#264).
@jkcoxson
Copy link
Owner

Beautiful, thank you so much!

@jkcoxson jkcoxson merged commit fc70388 into jkcoxson:master Aug 30, 2024
@michaelwright235 michaelwright235 deleted the date branch August 30, 2024 19:39
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

Successfully merging this pull request may close these issues.

2 participants