• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(4316)  |  Call(3909)  |  Derive(0)  |  Import(407)
mktime(tuple) -> floating point number

Convert a time tuple in local time to seconds since the Epoch.

src/q/u/querychinesesto-HEAD/prog/gbk-encode-example.py   querychinesesto(Download)
print 'structÀàÐÍ', type(time.strptime('2008-02-06', '%Y-%m-%d'))
print 'utc: ', time.gmtime(), 'local: ', time.localtime()
print time.clock()
print time.time(), time.mktime(time.localtime()), time.time() == time.mktime(time.localtime())
 
from datetime import datetime
value = '2009-01-05'

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/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

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

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

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/c/l/clearversion-HEAD/trunk/clearVersion/etc/subversion/hooks/examples/svn2feed.py   clearversion(Download)
    def _format_updated_ts(self, revision_ts):
 
        # Get "2006-08-10 20:17:08" from 
        # "2006-07-28 20:17:18 +0530 (Fri, 28 Jul 2006)
        date = revision_ts[0:19]
        epoch = time.mktime(time.strptime(date, "%Y-%m-%d %H:%M:%S"))
        return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(epoch))

src/c/l/clearversion-HEAD/clearVersion/etc/subversion/hooks/examples/svn2feed.py   clearversion(Download)
    def _format_updated_ts(self, revision_ts):
 
        # Get "2006-08-10 20:17:08" from 
        # "2006-07-28 20:17:18 +0530 (Fri, 28 Jul 2006)
        date = revision_ts[0:19]
        epoch = time.mktime(time.strptime(date, "%Y-%m-%d %H:%M:%S"))
        return time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(epoch))

src/p/y/python-stategen-HEAD/examples/ical/icalpretty.py   python-stategen(Download)
        else:
            date_fmt = "%Y%m%dT%H%M%S"
        tm = time.strptime(_.value, date_fmt)
        utc = time.mktime(tm)
        if oldtz:
            os.environ['TZ'] = oldtz
        else:

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next