add SimpleDateFormat::new

This commit is contained in:
2020-05-31 21:57:13 +08:00
parent b862bcea8e
commit 8125eae1e5

View File

@@ -80,6 +80,10 @@ pub struct SimpleDateFormat {
impl SimpleDateFormat {
pub fn new(f: &str) -> Result<SimpleDateFormat, ParseError> {
fmt(f)
}
pub fn format<Tz>(&self, date_time: &DateTime<Tz>) -> String where Tz: TimeZone {
let mut ret = String::with_capacity(512);