Compare commits
72 Commits
adf242b3fd
...
4d3f09f011
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d3f09f011 | |||
| 00d1057ac6 | |||
| 1c2aaa4c46 | |||
| 99add10a4e | |||
| 9ebe88a7b4 | |||
| 3928e65d66 | |||
| 942908ca35 | |||
| eace55a4e8 | |||
| 25a898b219 | |||
| eeba5d4771 | |||
| 0a2b512b1d | |||
| 572837bf70 | |||
| 36f9d9bc61 | |||
| 348222f36c | |||
| 3df5851ab5 | |||
| 34c9c7d5f3 | |||
| 939ceea272 | |||
| ec508607e7 | |||
| 606add4f12 | |||
| 83a8ecf797 | |||
| 29fc7985dd | |||
| 2ddba2fd01 | |||
| d806823773 | |||
| 141d8cf7c2 | |||
| f39bad6499 | |||
| d591307a22 | |||
| e26c23efb6 | |||
| d638122d3a | |||
| 3b0f77e8d3 | |||
| 823ccdfc27 | |||
| a217d5dbb0 | |||
| 07ad3e613e | |||
| 295b90946b | |||
| 8f37ae840d | |||
| 8a2ff91cdc | |||
| 5f6f2c02ad | |||
| b88ff0340c | |||
| 3001ce4276 | |||
| 763a6e7ca2 | |||
| be163e81e6 | |||
| e6c3e22bf9 | |||
| 335a60d717 | |||
| 1b1e5c1af7 | |||
| e2e70a3c41 | |||
| 6d46d5e96b | |||
| e7a7c5910e | |||
| 0f9042aa4b | |||
| 7ed3a30d5a | |||
| 03207ba7cb | |||
| 4aaeb75bf3 | |||
| c0aded3ef0 | |||
| 6cdf7a43da | |||
| be5554664a | |||
| 30ff72f409 | |||
| 5517a42c1c | |||
| ad666aace9 | |||
| 004ea96f59 | |||
| 8c9b211a50 | |||
| 1bc1d185b6 | |||
| fde97ce507 | |||
| dce6aa6330 | |||
| b4c7a9ed26 | |||
| 97ee1d891a | |||
| 2a5af9f86b | |||
| 5772f3aa68 | |||
| 6af4161648 | |||
| 8567e317c9 | |||
| 2c1e1d62fb | |||
| 5dbcf6e4bf | |||
| 7774f574bf | |||
| 176b6cbe61 | |||
| 2465e21977 |
517
Cargo.lock
generated
517
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
38
Cargo.toml
38
Cargo.toml
@@ -6,36 +6,36 @@ edition = "2021"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix = "0.13.1"
|
actix = "0.13.2"
|
||||||
actix-identity = "0.5.2"
|
actix-identity = "0.7.0"
|
||||||
actix-web = "4"
|
actix-web = "4"
|
||||||
actix-session = { version = "0.7.2", features = ["cookie-session"] }
|
actix-session = { version = "0.9.0", features = ["cookie-session"] }
|
||||||
actix-remote-ip = "0.1.0"
|
actix-remote-ip = "0.1.0"
|
||||||
clap = { version = "4.4.1", features = ["derive", "env"] }
|
clap = { version = "4.4.18", features = ["derive", "env"] }
|
||||||
include_dir = "0.7.3"
|
include_dir = "0.7.3"
|
||||||
log = "0.4.20"
|
log = "0.4.20"
|
||||||
serde_json = "1.0.104"
|
serde_json = "1.0.113"
|
||||||
serde_yaml = "0.9.25"
|
serde_yaml = "0.9.30"
|
||||||
env_logger = "0.10.0"
|
env_logger = "0.11.1"
|
||||||
serde = { version = "1.0.181", features = ["derive"] }
|
serde = { version = "1.0.196", features = ["derive"] }
|
||||||
bcrypt = "0.15.0"
|
bcrypt = "0.15.0"
|
||||||
uuid = { version = "1.4.1", features = ["v4"] }
|
uuid = { version = "1.6.1", features = ["v4"] }
|
||||||
mime_guess = "2.0.4"
|
mime_guess = "2.0.4"
|
||||||
askama = "0.12.0"
|
askama = "0.12.1"
|
||||||
futures-util = "0.3.28"
|
futures-util = "0.3.30"
|
||||||
urlencoding = "2.1.3"
|
urlencoding = "2.1.3"
|
||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
base64 = "0.21.3"
|
base64 = "0.21.7"
|
||||||
jwt-simple = "0.11.6"
|
jwt-simple = { version = "0.12.7", default-features=false, features=["pure-rust"] }
|
||||||
digest = "0.10.7"
|
digest = "0.10.7"
|
||||||
sha2 = "0.10.7"
|
sha2 = "0.10.8"
|
||||||
lazy-regex = "3.0.1"
|
lazy-regex = "3.1.0"
|
||||||
totp_rfc6238 = "0.5.1"
|
totp_rfc6238 = "0.5.1"
|
||||||
base32 = "0.4.0"
|
base32 = "0.4.0"
|
||||||
qrcode-generator = "4.1.8"
|
qrcode-generator = "4.1.9"
|
||||||
webauthn-rs = { version = "0.4.8", features = ["danger-allow-state-serialisation"] }
|
webauthn-rs = { version = "0.4.8", features = ["danger-allow-state-serialisation"] }
|
||||||
url = "2.4.1"
|
url = "2.5.0"
|
||||||
light-openid = { version = "1.0.1", features=["crypto-wrapper"] }
|
light-openid = { version = "1.0.1", features=["crypto-wrapper"] }
|
||||||
bincode = "2.0.0-rc.3"
|
bincode = "2.0.0-rc.3"
|
||||||
chrono = "0.4.26"
|
chrono = "0.4.33"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
|
|||||||
@@ -16,8 +16,23 @@ pub fn fmt_time(timestamp: u64) -> String {
|
|||||||
NaiveDateTime::from_timestamp_opt(timestamp as i64, 0).expect("Failed to parse timestamp!");
|
NaiveDateTime::from_timestamp_opt(timestamp as i64, 0).expect("Failed to parse timestamp!");
|
||||||
|
|
||||||
// Create a normal DateTime from the NaiveDateTime
|
// Create a normal DateTime from the NaiveDateTime
|
||||||
let datetime: DateTime<Utc> = DateTime::from_utc(naive, Utc);
|
let datetime: DateTime<Utc> = DateTime::from_naive_utc_and_offset(naive, Utc);
|
||||||
|
|
||||||
// Format the datetime how you want
|
// Format the datetime how you want
|
||||||
datetime.format("%Y-%m-%d %H:%M:%S").to_string()
|
datetime.format("%Y-%m-%d %H:%M:%S").to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod test {
|
||||||
|
use crate::utils::time::{fmt_time, time};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_time() {
|
||||||
|
assert!(time() > 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_fmt_time() {
|
||||||
|
assert_eq!(fmt_time(1693475465), "2023-08-31 09:51:05");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user