Alter this short date by a number of years into future/past. The changed value will not be assumed if it amounts to an out of range date.
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzSDate::AltYear | (int32_t,) |
Declared in file: hzDate.h
Defined in file : hzDate.cpp
Function Logic:
Function body:
hzEcode hzSDate::AltYear (int32_t interval)
{
// Alter this short date by a number of years into future/past. The changed value will not be assumed if it amounts to an out of range
// date.
//
// Arguments: 1) x Number of years into future/past
//
// Returns: E_RANGE If the supplied interval rendered this date invalid
// E_OK If the supplied interval was applied
uint32_t Y ; // Year part
uint32_t M ; // Month part
uint32_t D ; // Day part
if (interval < 0&& (m_days + interval) < 0)
return E_RANGE ;
if ((m_days + interval) > DAYS_IN_10K)
return E_RANGE ;
_datefromdays(Y, M, D, m_days) ;
Y += interval ;
return _daysfromdate(m_days, Y, M, D) ;
}