Package Gnumed :: Package pycommon :: Module gmDateTime :: Class cFuzzyTimestamp
[frames] | no frames]

Class cFuzzyTimestamp

source code

A timestamp implementation with definable inaccuracy.

This class contains an mxDateTime.DateTime instance to
hold the actual timestamp. It adds an accuracy attribute
to allow the programmer to set the precision of the
timestamp.

The timestamp will have to be initialzed with a fully
precise value (which may, of course, contain partially
fake data to make up for missing values). One can then
set the accuracy value to indicate up to which part of
the timestamp the data is valid. Optionally a modifier
can be set to indicate further specification of the
value (such as "summer", "afternoon", etc).

accuracy values:
        1: year only
        ...
        7: everything including milliseconds value

Unfortunately, one cannot directly derive a class from mx.DateTime.DateTime :-(

Instance Methods
 
__init__(self, timestamp=None, accuracy=8, modifier='') source code
 
__str__(self)
Return string representation meaningful to a user, also for %s formatting.
source code
 
__repr__(self)
Return string meaningful to a programmer to aid in debugging.
source code
 
strftime(self, format_string) source code
 
Format(self, format_string) source code
 
format_accurately(self, accuracy=None) source code
 
get_mxdt(self) source code
 
get_pydt(self) source code