feat: use server time if it's not specified (#1480)

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-04-27 20:54:26 +08:00
committed by GitHub
parent b1f7ad097a
commit 0ac50632aa
3 changed files with 55 additions and 28 deletions

View File

@@ -17,6 +17,11 @@ pub fn current_time_millis() -> i64 {
chrono::Utc::now().timestamp_millis()
}
/// Returns the current time in rfc3339 format.
pub fn current_time_rfc3339() -> String {
chrono::Utc::now().to_rfc3339()
}
/// Port of rust unstable features `int_roundings`.
pub(crate) fn div_ceil(this: i64, rhs: i64) -> i64 {
let d = this / rhs;