mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
refactor(common_utils): move serde implementations and date-time utils to common_utils crate (#40)
This commit is contained in:
@ -13,5 +13,17 @@
|
||||
)]
|
||||
#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR" ), "/", "README.md"))]
|
||||
|
||||
pub mod custom_serde;
|
||||
pub mod errors;
|
||||
pub mod ext_traits;
|
||||
|
||||
/// Date-time utilities.
|
||||
pub mod date_time {
|
||||
use time::{OffsetDateTime, PrimitiveDateTime};
|
||||
|
||||
/// Create a new [`PrimitiveDateTime`] with the current date and time in UTC.
|
||||
pub fn now() -> PrimitiveDateTime {
|
||||
let utc_date_time = OffsetDateTime::now_utc();
|
||||
PrimitiveDateTime::new(utc_date_time.date(), utc_date_time.time())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user