switched to sqlite
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use std::fmt;
|
||||
use std::time::SystemTime;
|
||||
|
||||
use chrono::{DateTime, NaiveDateTime, Utc};
|
||||
use chrono::{DateTime, NaiveDateTime, TimeZone, Utc};
|
||||
use diesel::prelude::*;
|
||||
|
||||
use serde::Deserialize;
|
||||
@ -14,7 +14,6 @@ use crate::schema;
|
||||
#[diesel(table_name = schema::servers)]
|
||||
#[diesel(check_for_backend(diesel::sqlite::Sqlite))]
|
||||
pub struct Servers {
|
||||
pub id: i64,
|
||||
pub name: String,
|
||||
pub last_login: Option<NaiveDateTime>,
|
||||
pub container_id: Option<String>,
|
||||
@ -38,7 +37,7 @@ impl fmt::Display for Servers {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let login = match self.last_login {
|
||||
Some(date) => {
|
||||
let datetime: DateTime<Utc> = date.into();
|
||||
let datetime: DateTime<Utc> = Utc.from_utc_datetime(&date);
|
||||
|
||||
format!("{}", datetime.format("%d-%m-%Y at %H:%M").to_string())
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user