objects.logic.utils.timeUtil.timeUtil Class Reference

Time related formatting and conversion utilities. More...

List of all members.

Public Member Functions

def __init__
def formatTime
 Formats a time object.
def formatTimeDiff
 Formats a the difference between now and the supplied parameter.
def formatDateTime
 Formats a time object.

Static Public Attributes

tuple formatTime = staticmethod(formatTime)
tuple formatTimeDiff = staticmethod(formatTimeDiff)
tuple formatDateTime = staticmethod(formatDateTime)


Detailed Description

Time related formatting and conversion utilities.

Definition at line 23 of file timeUtil.py.


Member Function Documentation

def objects.logic.utils.timeUtil.timeUtil.__init__ (   self  ) 

Definition at line 24 of file timeUtil.py.

00024                       :
00025         pass
00026     
    ## Formats a time object.

Formats a time object.

Parameters:
t Integer (something like what time.time() would return)
Returns:
MM/DD/YYYY HH:MM:SS Formatted String

Definition at line 62 of file timeUtil.py.

00062                          :        
00063         try:
00064             fmt = time.localtime(t)
00065         except Exception, e:     
00066             logger.log(__name__ + ": Could not contruct time object from input")       
00067             return ""
00068         
00069         return time.strftime("%m/%d/%y %H:%M:%S", fmt) 
00070         
00071         
00072         
00073         
00074     

Formats a time object.

Parameters:
t Integer (something like what time.time() would return)
Returns:
HH:MM:SS Formatted String

Definition at line 30 of file timeUtil.py.

00030                      :
00031         try:
00032             fmt = time.localtime(t)
00033         except Exception, e:     
00034             logger.log(__name__ + ": Could not construct time object from input")       
00035             return ""
00036         
00037         return time.strftime("%H:%M:%S", fmt) 
00038     
00039     
    ## Formats a the difference between now and the supplied parameter.

Formats a the difference between now and the supplied parameter.

Parameters:
t Integer (something like what time.time() would return)
Returns:
"x Hrs y Min z Sec" Formatted String

Definition at line 43 of file timeUtil.py.

00043                          :
00044         Hrs = int(t / 3600)
00045         
00046         remainder =  t % 3600
00047         
00048         Min = int(remainder/60)
00049         
00050         remainder =  t % 60 
00051         
00052         Secs = int(remainder)
00053         
00054         retString = "%d Hrs %d Min %d Sec" % (Hrs, Min, Secs)
00055         return retString
00056     
00057     
00058     
    ## Formats a time object.


Member Data Documentation

Definition at line 77 of file timeUtil.py.

Definition at line 75 of file timeUtil.py.

Definition at line 76 of file timeUtil.py.


The documentation for this class was generated from the following file:

Generated on Mon Mar 30 00:26:46 2009 for EyeSpy by  doxygen 1.5.8