obspy.core.utcdatetime.UTCDateTime._set_precision

UTCDateTime._set_precision(value=6)[source]

Set precision of current UTCDateTime object.

Parameters:value (int, optional) Precision value used by the rich comparison operators. Defaults to 6.

Example

  1. Default precision

    >>> dt = UTCDateTime()
    >>> dt.precision
    6
    
  2. Set precision during initialization of UTCDateTime object.

    >>> dt = UTCDateTime(precision=5)
    >>> dt.precision
    5
    
  3. Set precision for an existing UTCDateTime object.

    >>> dt = UTCDateTime()
    >>> dt.precision = 12
    >>> dt.precision
    12