src/tools/time.rs: rename rfc_3339 to rfc3339

This commit is contained in:
Dietmar Maurer 2020-09-13 11:42:15 +02:00
parent 317d1a78fb
commit b164904a4f

View File

@ -121,13 +121,13 @@ pub fn strftime(format: &str, t: &libc::tm) -> Result<String, Error> {
}
/// 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)?;
strftime("%FT%TZ", &gmtime)
}
/// 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)?;
@ -154,7 +154,7 @@ pub fn epoch_to_rfc_3339(epoch: i64) -> Result<String, Error> {
}
/// 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();