1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use chrono::naive::NaiveDateTime;
mod retries;
pub use retries::{retry_future, Retryable};
const DATE_FMT: &str = "%Y%m%d%H%M%S";
pub fn parse_timestamp(input: &str) -> Option<NaiveDateTime> {
NaiveDateTime::parse_from_str(input, DATE_FMT).ok()
}
pub fn to_timestamp(input: &NaiveDateTime) -> String {
input.format(DATE_FMT).to_string()
}
pub mod redirect {
pub fn guess_redirect_content(url: &str) -> String {
format!(
"<html><body>You are being <a href=\"{}\">redirected</a>.</body></html>",
url
)
}
}