{}", 99 | build_item_footer(article) 100 | )); 101 | html 102 | } 103 | 104 | // Format creation date with offset as RFC2822. 105 | fn format_pub_date(ts: &str, off: i64) -> String { 106 | let base = DateTime::parse_from_rfc3339(ts) 107 | .unwrap_or_else(|_| Utc::now().into()) 108 | .with_timezone(&Utc); 109 | let dt = base 110 | .checked_add_signed(Duration::seconds(off)) 111 | .unwrap_or(base); 112 | dt.to_rfc2822() 113 | } 114 | 115 | // Build a