diff --git a/src/lib.rs b/src/lib.rs index eb226e8..38cbd4b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -80,6 +80,10 @@ pub struct SimpleDateFormat { impl SimpleDateFormat { + pub fn new(f: &str) -> Result { + fmt(f) + } + pub fn format(&self, date_time: &DateTime) -> String where Tz: TimeZone { let mut ret = String::with_capacity(512);