• Home
  • Raw
  • Download

Lines Matching full:now

36     def _update_variables(self, now):  argument
38 self.gmt = time.gmtime(now)
39 now = time.localtime(now)
41 if now[3] < 12: self.ampm='(AM|am)'
44 self.jan1 = time.localtime(time.mktime((now[0], 1, 1, 0, 0, 0, 0, 1, 0)))
47 if now[8]: self.tz = time.tzname[1]
52 if now[3] > 12: self.clock12 = now[3] - 12
53 elif now[3] > 0: self.clock12 = now[3]
56 self.now = now
69 now = time.time()
70 self._update_variables(now)
71 self.strftest1(now)
72 self.strftest2(now)
80 arg = now + (i+j*100)*23*3603
85 def strftest1(self, now): argument
87 print "strftime test for", time.ctime(now)
88 now = self.now
92 ('%a', calendar.day_abbr[now[6]], 'abbreviated weekday name'),
93 ('%A', calendar.day_name[now[6]], 'full weekday name'),
94 ('%b', calendar.month_abbr[now[1]], 'abbreviated month name'),
95 ('%B', calendar.month_name[now[1]], 'full month name'),
97 ('%d', '%02d' % now[2], 'day of month as number (00-31)'),
98 ('%H', '%02d' % now[3], 'hour (00-23)'),
100 ('%j', '%03d' % now[7], 'julian day (001-366)'),
101 ('%m', '%02d' % now[1], 'month as number (01-12)'),
102 ('%M', '%02d' % now[4], 'minute, (00-59)'),
104 ('%S', '%02d' % now[5], 'seconds of current time (00-60)'),
105 ('%U', '%02d' % ((now[7] + self.jan1[6])//7),
107 ('%w', '0?%d' % ((1+now[6]) % 7), 'weekday as a number (Sun 1st)'),
108 ('%W', '%02d' % ((now[7] + (self.jan1[6] - 1)%7)//7),
111 ('%X', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'),
112 ('%y', '%02d' % (now[0]%100), 'year without century'),
113 ('%Y', '%d' % now[0], 'year with century'),
121 result = time.strftime(e[0], now)
133 def strftest2(self, now): argument
134 nowsecs = str(long(now))[:-1]
135 now = self.now
139 ('%c', fixasctime(time.asctime(now)), 'near-asctime() format'),
140 ('%x', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)),
145 ('%D', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), 'mm/dd/yy'),
146 ('%e', '%2d' % now[2], 'day of month as number, blank padded ( 0-31)'),
147 ('%h', calendar.month_abbr[now[1]], 'abbreviated month name'),
148 ('%k', '%2d' % now[3], 'hour, blank padded ( 0-23)'),
150 ('%r', '%02d:%02d:%02d %s' % (self.clock12, now[4], now[5], self.ampm),
152 ('%R', '%02d:%02d' % (now[3], now[4]), '%H:%M'),
155 ('%T', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'),
156 ('%3y', '%03d' % (now[0]%100),
162 result = time.strftime(e[0], now)