HecTime
HecTime is one of the most frequently used classes with HEC-DSS. It holds a date and time value, and performs various functions with those, such as incrementing a date/time or returning a date/time in a formatted string in a specific style.
HecTime holds a date component, which is Julian days (day count) since 01Jan1900, and a time component, which is seconds past midnight (for the specified Julian day.) In addition, the date/time “granularity” may be set to specify the precision of the date/time. The granularity says to work with and return the date/time to the nearest second or minute or hour or day. For example, if you were to set the granularity to “hour”, the time would always be displayed with no, or in this case, zero, minutes; you would have 0800 or 0900 for the time, but not 0830. Since DSS generally identifies values to the minute, the default granularity is “minute”. DSS-7 supports data to the nearest second, so “second” granularity may be used for that type of data. HecTime does not support a time granularity of less than one second.
Most data in DSS is reported as end-of-period; for example, a daily average data value cannot be computed until the end of the day. The default reporting for HecTime is end-of-period, meaning that midnight occurs at the end of the day, not at the beginning. A midnight time will be returned as “2400”. Be aware of this, as some other commercial programs (such as Excel) use only beginning of day time for midnight. However, there are some instances where a beginning of period time should be used, for example, the beginning time of the measurement of a data set obtained from radar. HecTime contains a function to return times as beginning of period (“0000” for midnight). See the following for that function.
For more information see the HecTime Java Documentation and the DSSVue documentation discussion on HecTime: