HecTime Class

Detailed Documentation

Example Usage

General

HecTime objects are unnamed objects that represent time instances in a proleptic Julian calendar. The instances may be specified at various granularities (precisions) that affect range of instances supported:

Granularity / Precision

Available Fields

Year Range

Time Zone?

Second

year, month, day, hour, minute, second

1901..2038

Yes

Minute

year, month, day, hour, minute

-2184..5938

Yes

Hour

year, month, day, hour

-243084..246883

Yes

Day

year, month, day

-5877711..5879610

No

The default granularity is 1 Minute.

Backward Compatibility

The HecTime class provides complete compatibility for HEC’s hec.heclib.util.HecTime Java class, which is necessary to process and generate the vast range of time integer values used in existing HEC-DSS files. [1]

HecTime supports all the methods of the Java class, although some of the support is through properties and operators instead of methods. The python method names are in snake case instead of camel case as in Java (e.g., adjustToIntervalOffset() becomes adjust_to_interval_offset()) .

Compatibility with datetime.datetime

HecTime is designed to interoperate with Python’s datetime.datetime. It has many of the same methods, properites and operators and is easily convertible to/from datetime.datetime. [2] [3]