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

build: Bump chrono from 0.4.26 to 0.4.28 #276

Merged
merged 2 commits into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/rtc_goldfish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use crate::mem::MemoryRegion;
use atomic_refcell::AtomicRefCell;
use chrono::{DateTime, Datelike, NaiveDateTime, Timelike, Utc};
use chrono::{Datelike, NaiveDateTime, Timelike};

// TODO: Fill from FDT
const RTC_GOLDFISH_ADDRESS: u64 = 0x101000;
Expand Down Expand Up @@ -36,7 +36,7 @@ pub fn read_date() -> Result<(u8, u8, u8), ()> {
let ts = RTC_GOLDFISH.borrow_mut().read_ts();

let naive = NaiveDateTime::from_timestamp_opt(ts as i64, 0).ok_or(())?;
let datetime: DateTime<Utc> = DateTime::from_utc(naive, Utc);
let datetime = naive.and_utc();
Ok((
(datetime.year() - 2000) as u8,
datetime.month() as u8,
Expand All @@ -47,7 +47,7 @@ pub fn read_date() -> Result<(u8, u8, u8), ()> {
pub fn read_time() -> Result<(u8, u8, u8), ()> {
let ts = RTC_GOLDFISH.borrow_mut().read_ts();
let naive = NaiveDateTime::from_timestamp_opt(ts as i64, 0).ok_or(())?;
let datetime: DateTime<Utc> = DateTime::from_utc(naive, Utc);
let datetime = naive.and_utc();
Ok((
datetime.hour() as u8,
datetime.minute() as u8,
Expand Down
6 changes: 3 additions & 3 deletions src/rtc_pl031.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (C) 2022 Akira Moroo

use atomic_refcell::AtomicRefCell;
use chrono::{DateTime, Datelike, NaiveDateTime, Timelike, Utc};
use chrono::{Datelike, NaiveDateTime, Timelike};

use crate::{arch::aarch64::layout::map, mem};

Expand All @@ -28,7 +28,7 @@ impl Pl031 {
pub fn read_date(&self) -> Result<(u8, u8, u8), ()> {
let timestamp = self.read_timestamp();
let naive = NaiveDateTime::from_timestamp_opt(timestamp as i64, 0).ok_or(())?;
let datetime: DateTime<Utc> = DateTime::from_utc(naive, Utc);
let datetime = naive.and_utc();
Ok((
(datetime.year() - 2000) as u8,
datetime.month() as u8,
Expand All @@ -39,7 +39,7 @@ impl Pl031 {
pub fn read_time(&self) -> Result<(u8, u8, u8), ()> {
let timestamp = self.read_timestamp();
let naive = NaiveDateTime::from_timestamp_opt(timestamp as i64, 0).ok_or(())?;
let datetime: DateTime<Utc> = DateTime::from_utc(naive, Utc);
let datetime = naive.and_utc();
Ok((
datetime.hour() as u8,
datetime.minute() as u8,
Expand Down