mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-20 00:15:17 +00:00
Can show command line help
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
use chrono::{TimeZone, Utc};
|
||||
use chrono::{TimeZone, Utc, Datelike};
|
||||
|
||||
/// Get the current time since epoch
|
||||
///
|
||||
@ -34,4 +34,10 @@ pub fn time_to_mysql_date(time: u64) -> String {
|
||||
/// Get current Mysql formatted date
|
||||
pub fn mysql_date() -> String {
|
||||
time_to_mysql_date(time())
|
||||
}
|
||||
|
||||
/// Get current year
|
||||
pub fn current_year() -> i32 {
|
||||
let utc = Utc.timestamp(time() as i64, 0);
|
||||
utc.year()
|
||||
}
|
Reference in New Issue
Block a user