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

All Samples(37647)  |  Call(10)  |  Derive(0)  |  Import(37637)
This module provides various functions to manipulate time values.

There are two standard representations of time.  One is the number
of seconds since the Epoch, in UTC (a.k.a. GMT).  It may be an integer
or a floating point number (to represent fractions of seconds).
The Epoch is system-defined; on Unix, it is generally January 1st, 1970.
The actual value can be retrieved by calling gmtime(0).

The other representation is a tuple of 9 integers giving local time.
The tuple items are:
  year (four digits, e.g. 1998)
  month (1-12)
  day (1-31)
  hours (0-23)
  minutes (0-59)
  seconds (0-59)
  weekday (0-6, Monday is 0)
  Julian day (day in the year, 1-366)
  DST (Daylight Savings Time) flag (-1, 0 or 1)
If the DST flag is 0, the time is given in the regular time zone;
if it is 1, the time is given in the DST time zone;
if it is -1, mktime() should guess based on the date and time.

Variables:

timezone -- difference in seconds between UTC and local standard time
altzone -- difference in  seconds between UTC and local DST time
daylight -- whether local time should reflect DST
tzname -- tuple of (standard time zone name, DST time zone name)

Functions:

time() -- return current time in seconds since the Epoch as a float
clock() -- return CPU time since process start as a float
sleep() -- delay for a number of seconds given as a float
gmtime() -- convert seconds since Epoch to UTC tuple
localtime() -- convert seconds since Epoch to local time tuple
asctime() -- convert time tuple to string
ctime() -- convert time in seconds to string
mktime() -- convert local time tuple to seconds since Epoch
strftime() -- convert time tuple to string according to format specification
strptime() -- parse string to time tuple according to format specification
tzset() -- change the local timezone

src/n/s/nsplugin-HEAD/trunk/GTDTimer/src/GTDTimer.py   nsplugin(Download)
    from AppData import *
    import string
    import StringIO
    import time
    from threading import *
    from time import *
    from wxPython.wx import *    
    def SetAlarms(self, alarms, notify_window):
        self.alarms = alarms
        self._notify_window = notify_window
        self.reset_time=int(time())
        if (alarms>0):
            self.timeout_reached=0
        else:
    def Notify(self):
        # Check the time, check the next alarm, sound alarm if it is time
        now = wxDateTime_Now()
 
        # Evaluate remaining time.  All the evaluation is being calculate as "int" since we are only
        # interested in the number of seconds remaining.
        countdown_int=int(self.alarms-(int(time())-self.reset_time))

src/n/s/nsplugin-HEAD/GTDTimer/src/GTDTimer.py   nsplugin(Download)
    from AppData import *
    import string
    import StringIO
    import time
    from threading import *
    from time import *
    from wxPython.wx import *    
    def SetAlarms(self, alarms, notify_window):
        self.alarms = alarms
        self._notify_window = notify_window
        self.reset_time=int(time())
        if (alarms>0):
            self.timeout_reached=0
        else:
    def Notify(self):
        # Check the time, check the next alarm, sound alarm if it is time
        now = wxDateTime_Now()
 
        # Evaluate remaining time.  All the evaluation is being calculate as "int" since we are only
        # interested in the number of seconds remaining.
        countdown_int=int(self.alarms-(int(time())-self.reset_time))

src/o/r/orcatorrent-HEAD/Main/vwxGUI/PersonsItemPanel.py   orcatorrent(Download)
# Written by Jelle Roozenburg, Maarten ten Brinke, Arno Bakker 
# see LICENSE.txt for license information
 
import wx, math, time, os, sys, threading
import random
from traceback import print_exc
from wx.lib.stattext import GenStaticText as StaticText
                bmp = data['metadata'].get('ThumbnailBitmap')
                tt = data['metadata'].get('tried_time')
                if not bmp:
                    now = time()
                    #print >>sys.stderr,"BMP IS NONE",data['name']
                    if now > tt+(15*60.0):
                        #print >>sys.stderr,"REFRESH OF PEER IMAGE SCHEDULED"
            print >>sys.stderr,"pip: ThumbnailViewer: GUI callback"
 
        metadata = {}
        metadata['tried_time'] = time()+(random.random()*100)
        if mimetype is not None:
            metadata['ThumbnailBitmap'] = data2wxBitmap(mimetype,bmpdata)
        else:

src/o/r/orcatorrent-HEAD/Main/vwxGUI/LibraryItemPanel.py   orcatorrent(Download)
# Written by Jelle Roozenburg, Maarten ten Brinke, Arno Bakker 
# see LICENSE.txt for license information
 
import wx, math, time, os, sys, threading
from traceback import print_exc,print_stack
from copy import deepcopy
from wx.lib.stattext import GenStaticText as StaticText
    def updateProgress(self, infohash, progress):
        #print >> sys.stderr, 'Lib: updateProgress: %s %s' % (self.title.GetLabel(), progress)
 
        if infohash not in self.cache_progress:
            self.cache_progress[infohash] = 0 # progress
        now = time()
        if progress - self.cache_progress[infohash] > 1:

src/y/a/yapa-accounting-HEAD/trunk/pygtk/CustomersGTK.py   yapa-accounting(Download)
	sys.exit(1)
 
import ToolGTK, YapaPrinting, settings
import time
import Yapa
from OrdersGTK import *
 
	def on_btnRemove_clicked(self, widget):
		tmp = self.widget("txtCustomerNr").get_text()
		if "No" == ToolGTK.YesNo ("Are you shure you want to remove this customer?"):
			return
		if self.cust.remove(tmp):
			settings.write("CustomersLastChange", int(time()))
			ToolGTK.MsgBox("Customer succesfully removed.")

src/y/a/yapa-accounting-HEAD/pygtk/CustomersGTK.py   yapa-accounting(Download)
	sys.exit(1)
 
import ToolGTK, YapaPrinting, settings
import time
import Yapa
from OrdersGTK import *
 
	def on_btnRemove_clicked(self, widget):
		tmp = self.widget("txtCustomerNr").get_text()
		if "No" == ToolGTK.YesNo ("Are you shure you want to remove this customer?"):
			return
		if self.cust.remove(tmp):
			settings.write("CustomersLastChange", int(time()))
			ToolGTK.MsgBox("Customer succesfully removed.")

src/c/o/code2test-HEAD/include/CodeToTest/dataStorage.py   code2test(Download)
import sys,os,time,pickle,base64,zlib
import utils,ctags
from time import *
from plugins.tree import *
 
TreeData=None
 
def saveStorage (filename,TreeData,NameSpaces):
    ##build dataclass first
    ds=dataStorageV1()
    ds.CreationDate = time()
    ds.StorageVersion = 1
    ds.TreeData = (TreeData,NameSpaces)