All Samples(7042) | Call(6652) | Derive(0) | Import(390)
localtime([seconds]) -> (tm_year,tm_mon,tm_mday,tm_hour,tm_min,
tm_sec,tm_wday,tm_yday,tm_isdst)
Convert seconds since the Epoch to a time tuple expressing local time.
When 'seconds' is not passed in, convert the current time instead.src/e/d/Edwin-HEAD/scripts/jabber/doc/examples/logger.py Edwin(Download)
def LOG(stanza,nick,text):
ts=stanza.getTimestamp()
if not ts:
ts=stanza.setTimestamp()
ts=stanza.getTimestamp()
tp=time.mktime(time.strptime(ts,'%Y%m%dT%H:%M:%S %Z'))+3600*3
if time.localtime()[-1]: tp+=3600
tp=time.localtime(tp)
src/f/b/fb-commut-HEAD/trunk/ifaces/jabber-comm-remote/xmpppy-0.4.1/doc/examples/logger.py fb-commut(Download)
def LOG(stanza,nick,text):
ts=stanza.getTimestamp()
if not ts:
ts=stanza.setTimestamp()
ts=stanza.getTimestamp()
tp=time.mktime(time.strptime(ts,'%Y%m%dT%H:%M:%S %Z'))+3600*3
if time.localtime()[-1]: tp+=3600
tp=time.localtime(tp)
src/f/b/fb-commut-HEAD/ifaces/jabber-comm-remote/xmpppy-0.4.1/doc/examples/logger.py fb-commut(Download)
def LOG(stanza,nick,text):
ts=stanza.getTimestamp()
if not ts:
ts=stanza.setTimestamp()
ts=stanza.getTimestamp()
tp=time.mktime(time.strptime(ts,'%Y%m%dT%H:%M:%S %Z'))+3600*3
if time.localtime()[-1]: tp+=3600
tp=time.localtime(tp)
src/p/y/pyjamas-0.7/examples/libtest/TimeModuleTest.py Pyjamas(Download)
def testBasics(self):
t = time.time()
self.assertTrue(t > 1246924800, "time.time() result invalid")
ttuple1 = time.gmtime(t)
t1 = time.mktime(ttuple1)
ttuple2 = time.localtime(t + time.timezone)
t2 = time.mktime(ttuple2)
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Doc/PythonDocs/includes/tzinfo-examples.py ironruby(Download)
def _isdst(self, dt):
tt = (dt.year, dt.month, dt.day,
dt.hour, dt.minute, dt.second,
dt.weekday(), 0, -1)
stamp = _time.mktime(tt)
tt = _time.localtime(stamp)
return tt.tm_isdst > 0
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Doc/IronPythonDocs/includes/tzinfo-examples.py ironruby(Download)
def _isdst(self, dt):
tt = (dt.year, dt.month, dt.day,
dt.hour, dt.minute, dt.second,
dt.weekday(), 0, -1)
stamp = _time.mktime(tt)
tt = _time.localtime(stamp)
return tt.tm_isdst > 0
src/g/1/g15m-HEAD/trunk/lglcd/Examples/DateTime.py g15m(Download)
running = True
while running:
# Get current time
now = time.localtime(time.time())
lcd.SetText(txtTime, time.strftime("%H:%M:%S", now) )
lcd.SetText(txtDate, time.strftime("%A %d %B", now) )
lcd.SetText(txtWeekDay, time.strftime("Week: %W Day: %j") )
src/g/1/g15m-HEAD/trunk/lglcd/Examples/CPURamGraph.py g15m(Download)
lcd.SetProgressBarPosition(ramBar, ramUsage)
lcd.AddGraphData(ramGraph, ramUsage)
# update current time & date
now = time.localtime(time.time())
lcd.SetText(txtTimeDate, time.strftime("%H:%M:%S %A %d %B", now) )
lcd.SetText(txtWeekDay, time.strftime("Week: %W Day: %j") )
src/g/1/g15m-HEAD/trunk/lglcd/Examples/CpuRamDatev2.py g15m(Download)
lcd.SetProgressBarPosition(ramBar, ramCounter.get_usage() )
# update current time & date
now = time.localtime(time.time())
lcd.SetText(txtTimeDate, time.strftime("%H:%M:%S %A %d %B", now) )
lcd.SetText(txtWeekDay, time.strftime("Week: %W Day: %j") )
src/g/1/g15m-HEAD/trunk/lglcd/Examples/CpuRamDate.py g15m(Download)
lcd.SetProgressBarPosition(ramBar, ramCounter.get_usage() )
# update current time & date
now = time.localtime(time.time())
lcd.SetText(txtTimeDate, time.strftime("%H:%M:%S %A %d %B", now) )
lcd.SetText(txtWeekDay, time.strftime("Week: %W Day: %j") )
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next