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

Timestamp format to/from epoch #413

Merged
merged 4 commits into from
Jan 6, 2024
Merged

Timestamp format to/from epoch #413

merged 4 commits into from
Jan 6, 2024

Conversation

jabbate19
Copy link
Collaborator

What type of PR is this?

/kind feature
/kind eldritch-function

What this PR does / why we need it:

Adds methods to re-format times to/from UNIX Epoch. Uses Chrono for formatting and parsing.

Which issue(s) this PR fixes:

Fixes #77
Fixes #78

@jabbate19 jabbate19 requested a review from hulto December 26, 2023 04:13
Copy link

codecov bot commented Dec 26, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (2e3f27e) 71.39% compared to head (51ee4f3) 71.45%.

Files Patch % Lines
implants/lib/eldritch/src/time.rs 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #413      +/-   ##
==========================================
+ Coverage   71.39%   71.45%   +0.05%     
==========================================
  Files         113      115       +2     
  Lines        8800     8832      +32     
==========================================
+ Hits         6283     6311      +28     
- Misses       2408     2412       +4     
  Partials      109      109              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@hulto hulto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change to docs otherwise LGTM

@@ -823,6 +823,14 @@ sys.shell("ls /nofile")

### time.sleep

`time.format_to_epoch(input: str, format: str) -> int`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide examples of the formats as well as a link to the docs on all acceptable formats whether that's the crate specific or the generic time formats.

@jabbate19 jabbate19 merged commit c626a12 into main Jan 6, 2024
8 checks passed
@jabbate19 jabbate19 deleted the timestamp_formats branch January 6, 2024 19:29
KCarretto pushed a commit that referenced this pull request Feb 1, 2024
 
Timestamp format to/from epoch (#413)

* Timestamp format to/from epoch

* Fix Docs

---------

Co-authored-by: Hulto <7121375+hulto@users.noreply.github.com>
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.

Implement time.format_to_epoch Implement time.format_to_readable
2 participants