-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fixed the utc_from_timestamp method ,added test cases #60
Conversation
Signed-off-by: shubham <[email protected]>
Signed-off-by: shubham <[email protected]>
Signed-off-by: shubham <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think @vigith asked for epoch(0) test. Could you add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub(crate) fn utc_from_timestamp(t: Option<Timestamp>) -> DateTime<Utc> {
t.map_or(Utc.timestamp_nanos(-1), |t| {
DateTime::from_timestamp(t.seconds, t.nanos as u32).unwrap_or(Utc.timestamp_nanos(-1))
})
}
use this, I have already fixed this issue in my PR
This is the right way to do, mathematical operations shouldn't be done directly on time |
Signed-off-by: shubham <[email protected]>
Signed-off-by: shubham <[email protected]>
ok |
This Pr fixes the issue
#59