The offsetTimeStruct() function
Applies an offset to a struct tm.
Description
inline struct tm offsetTimeStruct(const struct tm& time, int32
sqlOffset, bool* errorFlag = NULL)
time specifies a time value to offset.
sqlOffset specifies the time that is offset in minutes in the range of SQL_OFFSET_MIN to SQL_OFFSET_MAX inclusive.
errorFlag is an optional argument. If not NULL, it is set to true if isValidSqlOffset(sqlOffset) is false or isValidTimeStruct(time) is false or isValidTimeStruct(offset_time) is false. Otherwise, it is set to false.
Returns
Assume offset_time = tm +/- appropriate offset added, which can result in a different day, month, and so on. offset_time.tm_isdst is set to -1. The fields set are offset_time.tm_mday, offset_time.tm_yday, offset_time.tm_year, offset_time.tm_mon, offset_time.tm_hour, offset_time.tm_min and offset_time.tm_sec. When applicable, all other fields of offset_time are set to 0. Returns an indeterminate value otherwise.
Returns offset_time, if *errorFlag is NULL and an exception is not thrown or if, *errorFlag is not NULL and, after the call, *errorFlag is false.
Otherwise, the function returns an indeterminate value.
Throws
The function throws an opaque exception object if errorFlag is NULL and (isValidSqlOffset(sqlOffset) is false, or isValidEpoch(time) is false or isValidEpoch(time+sqlOffset*60) is false.