add: redis cache support
This commit is contained in:
parent
1d9a96ae69
commit
38dbf10130
13 changed files with 541 additions and 17 deletions
|
@ -12,10 +12,10 @@ pub fn unix_epoch_timestamp() -> u128 {
|
|||
}
|
||||
|
||||
/// Get a [`i64`] timestamp from the given `year` epoch
|
||||
pub fn epoch_timestamp(year: i32) -> i64 {
|
||||
pub fn epoch_timestamp(year: u32) -> i64 {
|
||||
let now = Utc::now().timestamp_millis();
|
||||
let then = Utc
|
||||
.with_ymd_and_hms(year, 1, 1, 0, 0, 0)
|
||||
.with_ymd_and_hms(year as i32, 1, 1, 0, 0, 0)
|
||||
.unwrap()
|
||||
.timestamp_millis();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue