コード例 #1
0
 def log_date_time_string(self):
     """Return the current time formatted for logging."""
     now = time.time()
     year, month, day, hh, mm, ss, x, y, z = time.localtime(now)
     s = "%02d/%3s/%04d %02d:%02d:%02d" % (
             day, self.monthname[month], year, hh, mm, ss)
     return s
コード例 #2
0
 def log_date_time_string(self):
     """Return the current time formatted for logging."""
     now = time.time()
     year, month, day, hh, mm, ss, x, y, z = time.localtime(now)
     s = "%02d/%3s/%04d %02d:%02d:%02d" % (day, self.monthname[month], year,
                                           hh, mm, ss)
     return s
コード例 #3
0
 def date_time_string(self, timestamp=None):
     """Return the current date and time formatted for a message header."""
     if timestamp is None:
         timestamp = time.time()
     year, month, day, hh, mm, ss, wd, y, z = time.gmtime(timestamp)
     s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
         self.weekdayname[wd], day, self.monthname[month], year, hh, mm, ss)
     return s
コード例 #4
0
 def date_time_string(self, timestamp=None):
     """Return the current date and time formatted for a message header."""
     if timestamp is None:
         timestamp = time.time()
     year, month, day, hh, mm, ss, wd, y, z = time.gmtime(timestamp)
     s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
             self.weekdayname[wd],
             day, self.monthname[month], year,
             hh, mm, ss)
     return s