[#BloombergLP-bdlt-Datetime-addSecondsIfValid] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::xref:BloombergLP/bdlt/Datetime.adoc[Datetime]::addSecondsIfValid :relfileprefix: ../../../ :mrdocs: Add seconds if the result remains a valid datetime. == Synopsis Declared in `<bdlt_datetime.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int addSecondsIfValid(xref:BloombergLP/bsls/Types/Int64.adoc[bsls::Types::Int64] seconds); ---- == Description Add the specified number of `seconds` to the value of this object, adjusting the "date" part of the object accordingly, if the resulting value is in the valid range for a `Datetime` object. If `24 == hour()` on entry, set the `hour` attribute to 0 before performing the addition. Return 0 on success, and a non‐zero value (with no effect) otherwise. Note that `seconds` may be positive, negative, or 0. == Return Value 0 on success, and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *seconds* | number of seconds to add (may be negative) |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#