mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-14 17:32:42 +00:00
src/tools/time.rs: rename rfc_3339 to rfc3339
This commit is contained in:
parent
317d1a78fb
commit
b164904a4f
@ -121,13 +121,13 @@ pub fn strftime(format: &str, t: &libc::tm) -> Result<String, Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Convert Unix epoch into RFC3339 UTC string
|
/// Convert Unix epoch into RFC3339 UTC string
|
||||||
pub fn epoch_to_rfc_3339_utc(epoch: i64) -> Result<String, Error> {
|
pub fn epoch_to_rfc3339_utc(epoch: i64) -> Result<String, Error> {
|
||||||
let gmtime = gmtime(epoch)?;
|
let gmtime = gmtime(epoch)?;
|
||||||
strftime("%FT%TZ", &gmtime)
|
strftime("%FT%TZ", &gmtime)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert Unix epoch into RFC3339 local time with TZ
|
/// Convert Unix epoch into RFC3339 local time with TZ
|
||||||
pub fn epoch_to_rfc_3339(epoch: i64) -> Result<String, Error> {
|
pub fn epoch_to_rfc3339(epoch: i64) -> Result<String, Error> {
|
||||||
|
|
||||||
let localtime = localtime(epoch)?;
|
let localtime = localtime(epoch)?;
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ pub fn epoch_to_rfc_3339(epoch: i64) -> Result<String, Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Parse RFC3339 into Unix epoch
|
/// Parse RFC3339 into Unix epoch
|
||||||
pub fn parse_rfc_3339(i: &str) -> Result<i64, Error> {
|
pub fn parse_rfc3339(i: &str) -> Result<i64, Error> {
|
||||||
|
|
||||||
let input = i.as_bytes();
|
let input = i.as_bytes();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user