def format(self, fmt, locale=None, timezone=None):
     self.formatter.setDateFormat_(fmt)
     if locale:
         self.formatter.setLocale_(
             NSLocale.alloc().initWithLocaleIdentifier_(locale))
     return self.formatter.stringFromDate_(self.nsdate).encode('utf-8')
 def format(self, fmt, locale = None, timezone = None):
     self.formatter.setDateFormat_(fmt)
     if locale:
         self.formatter.setLocale_(NSLocale.alloc().initWithLocaleIdentifier_(locale))
     return self.formatter.stringFromDate_(self.nsdate).encode('utf-8')