1
0
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:
2021-05-04 19:36:31 +02:00
parent 37a7efb5b3
commit e73ebe9c12
2 changed files with 63 additions and 31 deletions

View File

@ -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()
}