def _toRpcDateTime(self, date): u"""Converts the given date time to xml-rpc UTC time object.""" #$NON-NLS-1$ date = convertToUtcDateTime(date) format = self._getParameters().getParameter(IZBlogApiParamConstants.DATEFORMAT_OUT) if not format: format = u"%Y%m%dT%H:%M:%SZ" #$NON-NLS-1$ # if not UTC, use local time if not format.endswith(u"Z"): #$NON-NLS-1$ date = convertToLocalTime(date) xdts = date.strftime(str(format)) xdt = zoundry.blogpub.xmlrpc.zpatch.xmlrpclib.DateTime(xdts) return xdt
def _toRpcDateTime(self, date): u"""Converts the given date time to xml-rpc UTC time object.""" #$NON-NLS-1$ date = convertToUtcDateTime(date) format = self._getParameters().getParameter( IZBlogApiParamConstants.DATEFORMAT_OUT) if not format: format = u"%Y%m%dT%H:%M:%SZ" #$NON-NLS-1$ # if not UTC, use local time if not format.endswith(u"Z"): #$NON-NLS-1$ date = convertToLocalTime(date) xdts = date.strftime(str(format)) xdt = zoundry.blogpub.xmlrpc.zpatch.xmlrpclib.DateTime(xdts) return xdt
def getDateTime(self, localTime=False): if localTime: return convertToLocalTime(self.dateTime) return self.dateTime
def toString(self, formatString=u"%c", localTime=False): #$NON-NLS-1$ # Stupid strftime only takes a str, not a unicode. dt = self.getDateTime() if localTime: dt = convertToLocalTime(dt) return dt.strftime(str(formatString))
def getDateTime(self, localTime = False): if localTime: return convertToLocalTime(self.dateTime) return self.dateTime
def toString(self, formatString = u"%c", localTime = False): #$NON-NLS-1$ # Stupid strftime only takes a str, not a unicode. dt = self.getDateTime() if localTime: dt = convertToLocalTime(dt) return dt.strftime(str(formatString))