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

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/g/m/gmes-HEAD/trunk/examples/pmltest2d05.py   gmes(Download)
sys.path.append(new_path)
 
from sys import stdout
from time import localtime
from numpy import *
 
try:

src/g/m/gmes-HEAD/examples/pmltest2d05.py   gmes(Download)
sys.path.append(new_path)
 
from sys import stdout
from time import localtime
from numpy import *
 
try:

src/u/a/uaskitd-HEAD/legacy/trunk/bin/AskItd.py   uaskitd(Download)
            from threading import Timer
 
            from time import time
            from time import localtime
            from time import mktime
            from time import ctime
 
 
                    import time
                    import datelib
                    t = time.localtime()
                    df = DataFile( )
                    df.open( dcpdata[3] + "\\%d%s.txt" % ( datelib.currentWaterYear( t[0], t[1], t[2] ), dcpdata[1][name][0]["system"]), name.split(":")[1] )
                    df.write( tmpdata )  # external user should have locked the file
                        consolelog.write( "end date   is %s" % end_date )
                        oldlast = dcpdata[1][names[0]][0]["lastdate"]
                        tsdate = time.mktime( time.strptime( start_date, "%m/%d/%Y, %H%M" ) )
                        sdate = time.strftime( "%m/%d/%Y,%H:%M:%S" ,time.localtime( tsdate ) )
 
                        tsdate2 = time.mktime( time.strptime( end_date, "%m/%d/%Y, %H%M" ) )
                        edate = time.strftime( "%m/%d/%Y,%H:%M:%S" ,time.localtime( tsdate2 ) )

src/u/a/uaskitd-HEAD/askitd/bin/AskItd.py   uaskitd(Download)
            from threading import Timer
 
            from time import time
            from time import localtime
            from time import mktime
            from time import ctime
 
                                time_keys.sort()
                                for t in time_keys:
                                    try:
                                        shefDate = time.strftime( "%Y%m%d Z DH%H%M", time.localtime( t ) )
 
                                        common = ".A %s %s " % ( dcp.split(":")[1], shefDate )
                                        line = common
 
                    import time
                    import datelib
                    t = time.localtime()
                    df = DataFile( )
                    df.open( dcpdata[3] + "\\%d%s.txt" % ( datelib.currentWaterYear( t[0], t[1], t[2] ), dcpdata[1][name][0]["system"]), name.split(":")[1] )
                    df.write( tmpdata )  # external user should have locked the file
                        consolelog.write( "end date   is %s" % end_date )
                        oldlast = dcpdata[1][names[0]][0]["lastdate"]
                        tsdate = time.mktime( time.strptime( start_date, "%m/%d/%Y, %H%M" ) )
                        sdate = time.strftime( "%m/%d/%Y,%H:%M:%S" ,time.localtime( tsdate ) )
 
                        tsdate2 = time.mktime( time.strptime( end_date, "%m/%d/%Y, %H%M" ) )
                        edate = time.strftime( "%m/%d/%Y,%H:%M:%S" ,time.localtime( tsdate2 ) )

src/g/i/gimini-HEAD/trunk/new_stuff/gimini2/src/log4py.py   gimini(Download)
 
SECTION_DEFAULT = "Default"
 
from time import time, strftime, localtime
from types import StringType, ClassType, InstanceType, FileType, TupleType
from string import zfill, atoi, lower, upper, join, replace, split, strip
from re import sub
        self.__Logger_timelaststep = currenttime
        milliseconds = int(round((currenttime - long(currenttime)) * 1000))
        timeformat = sub("%S", "%S." + (zfill(milliseconds, 3)), self.__Logger_timeformat)
        currentformattedtime = strftime(timeformat, localtime(currenttime))
 
        line = self.__Logger_formatstring
        line = sub("%C", str(self.__Logger_classname), line)
        for i in range(len(self.__Logger_targets)):
            target = self.__Logger_targets[i]
            if (target == TARGET_MYSQL):
                sqltime = strftime("'%Y-%m-%d', '%H:%M:%S'", localtime(currenttime))
                sqlStatement = "INSERT INTO %s (host, facility, level, date, time, program, msg) VALUES ('%s', '%s', '%s', %s, '%s', '%s')" % (self.__Logger_mysql_tablename, self.hostname, self.__Logger_functionname, LOG_MSG[messagesource], sqltime, str(self.__Logger_classname), sub("'", "`", message + " " + ndc))
                self.__Logger_mysql_cursor.execute(sqlStatement)
            elif (target == TARGET_SYSLOG):
            strftime_mask = "%Y%W"
        elif (self.__FileAppender_rotation == ROTATE_MONTHLY):
            strftime_mask = "%Y%m"
        return (strftime(strftime_mask, localtime(time())) != strftime(strftime_mask, localtime(modification_time)))
 
    def __FileAppender_date_string(self, modification_time):
        """ **(private)** Returns a new filename for the rotated file with the appropriate time included. """
        if (self.__FileAppender_rotation == ROTATE_DAILY):
            return strftime("%Y-%m-%d", localtime(modification_time))
        elif (self.__FileAppender_rotation == ROTATE_WEEKLY):
            return strftime("%Y-Week %W", localtime(modification_time))
        elif (self.__FileAppender_rotation == ROTATE_MONTHLY):
            return strftime("%Y-Month %m", localtime(modification_time))

src/g/i/gimini-HEAD/new_stuff/gimini2/src/log4py.py   gimini(Download)
 
SECTION_DEFAULT = "Default"
 
from time import time, strftime, localtime
from types import StringType, ClassType, InstanceType, FileType, TupleType
from string import zfill, atoi, lower, upper, join, replace, split, strip
from re import sub
        self.__Logger_timelaststep = currenttime
        milliseconds = int(round((currenttime - long(currenttime)) * 1000))
        timeformat = sub("%S", "%S." + (zfill(milliseconds, 3)), self.__Logger_timeformat)
        currentformattedtime = strftime(timeformat, localtime(currenttime))
 
        line = self.__Logger_formatstring
        line = sub("%C", str(self.__Logger_classname), line)
        for i in range(len(self.__Logger_targets)):
            target = self.__Logger_targets[i]
            if (target == TARGET_MYSQL):
                sqltime = strftime("'%Y-%m-%d', '%H:%M:%S'", localtime(currenttime))
                sqlStatement = "INSERT INTO %s (host, facility, level, date, time, program, msg) VALUES ('%s', '%s', '%s', %s, '%s', '%s')" % (self.__Logger_mysql_tablename, self.hostname, self.__Logger_functionname, LOG_MSG[messagesource], sqltime, str(self.__Logger_classname), sub("'", "`", message + " " + ndc))
                self.__Logger_mysql_cursor.execute(sqlStatement)
            elif (target == TARGET_SYSLOG):
            strftime_mask = "%Y%W"
        elif (self.__FileAppender_rotation == ROTATE_MONTHLY):
            strftime_mask = "%Y%m"
        return (strftime(strftime_mask, localtime(time())) != strftime(strftime_mask, localtime(modification_time)))
 
    def __FileAppender_date_string(self, modification_time):
        """ **(private)** Returns a new filename for the rotated file with the appropriate time included. """
        if (self.__FileAppender_rotation == ROTATE_DAILY):
            return strftime("%Y-%m-%d", localtime(modification_time))
        elif (self.__FileAppender_rotation == ROTATE_WEEKLY):
            return strftime("%Y-Week %W", localtime(modification_time))
        elif (self.__FileAppender_rotation == ROTATE_MONTHLY):
            return strftime("%Y-Month %m", localtime(modification_time))

src/w/e/Webware-for-Python-1.0.2/WebKit/Admin/Main.py   Webware for Python(Download)
import os
from time import time, localtime, gmtime, asctime
 
from AdminSecurity import AdminSecurity
 
 
class Main(AdminSecurity):
	def writeGeneralInfo(self):
		app = self.application()
		curTime = time()
		info = (
			('Webware Version', app.webwareVersionString()),
			('WebKit Version',  app.webKitVersionString()),
			('Local Time',      asctime(localtime(curTime))),
			('Up Since',        asctime(localtime(app.server().startTime()))),

src/m/e/meresco-HEAD/meresco/bugfixes/version_2.13.x/meresco/components/oai/oaijazzlucene.py   meresco(Download)
## end license ##
 
from StringIO import StringIO
from time import strftime, gmtime, strptime, localtime, mktime
from re import compile
 
from cq2utils.xmlutils import findNamespaces
    def _fixUntilDate(self, aString):
        dateRE = compile('^\d{4}-\d{2}-\d{2}$')
        result = aString
        if dateRE.match(aString):
            dateFromString = strptime(aString, '%Y-%m-%d')
            datePlusOneDay = localtime(mktime(dateFromString) + 24*3600)
            result = strftime('%Y-%m-%dT%H:%M:%SZ', datePlusOneDay)

src/e/v/eventghost-HEAD/trunk/plugins/DVBViewer/__init__.py   eventghost(Download)
from win32com.taskscheduler import taskscheduler
from eg.WinApi import SendMessageTimeout
from threading import Thread, Event, Timer
from time import sleep, time, strptime, mktime, ctime, strftime, localtime, asctime
from eg.WinApi.Dynamic import (
    byref, sizeof, CreateProcess, WaitForSingleObject, FormatError,
    CloseHandle, create_unicode_buffer, 
 
        self.firedRecordingsIDs = []
 
        eg.PrintDebugNotice( "DVBViewer plugin started on " + strftime("%d %b %Y %H:%M:%S", localtime() ))
 
 
        return True
            #print "added: ", ix
            plugin.numberOfScheduledRecordings += 1
 
            runTime = localtime(date - leadTime )
 
            taskName = plugin.schedulerTaskNamePrefix + "%03d" % ix + ".job"
 
        actuals.sort()
 
        if len( dates ) > 0 :
            nextStartup = "Scheduled next wakeup at " + asctime( localtime( actuals[0] - leadTime ) )
            print nextStartup
            eg.PrintDebugNotice( nextStartup )
            return True

src/e/v/eventghost-HEAD/plugins/DVBViewer/__init__.py   eventghost(Download)
from win32com.taskscheduler import taskscheduler
from eg.WinApi import SendMessageTimeout
from threading import Thread, Event, Timer
from time import sleep, time, strptime, mktime, ctime, strftime, localtime, asctime
from eg.WinApi.Dynamic import (
    byref, sizeof, CreateProcess, WaitForSingleObject, FormatError,
    CloseHandle, create_unicode_buffer, 
 
        self.firedRecordingsIDs = []
 
        eg.PrintDebugNotice( "DVBViewer plugin started on " + strftime("%d %b %Y %H:%M:%S", localtime() ))
 
 
        return True
            #print "added: ", ix
            plugin.numberOfScheduledRecordings += 1
 
            runTime = localtime(date - leadTime )
 
            taskName = plugin.schedulerTaskNamePrefix + "%03d" % ix + ".job"
 
        actuals.sort()
 
        if len( dates ) > 0 :
            nextStartup = "Scheduled next wakeup at " + asctime( localtime( actuals[0] - leadTime ) )
            print nextStartup
            eg.PrintDebugNotice( nextStartup )
            return True

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