예제 #1
0
 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
예제 #2
0
 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
예제 #3
0
 def getDateTime(self, localTime=False):
     if localTime:
         return convertToLocalTime(self.dateTime)
     return self.dateTime
예제 #4
0
 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))
예제 #5
0
 def getDateTime(self, localTime = False):
     if localTime:
         return convertToLocalTime(self.dateTime)
     return self.dateTime
예제 #6
0
 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))