BloombergLP::bdlt::Datetime::setDatetimeIfValid

setDatetimeIfValid overloads

Synopses

Declared in <bdlt_datetime.h>

Set this object to date and optional time fields if valid.

int
setDatetimeIfValid(
    Date const& date,
    int hour = 0,
    int minute = 0,
    int second = 0,
    int millisecond = 0,
    int microsecond = 0);
» more...

Set this object from calendar fields if they form a valid datetime.

int
setDatetimeIfValid(
    int year,
    int month,
    int day,
    int hour = 0,
    int minute = 0,
    int second = 0,
    int millisecond = 0,
    int microsecond = 0);
» more...

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
datedate part to set
hourhour attribute (default 0)
minuteminute attribute (default 0)
secondsecond attribute (default 0)
millisecondmillisecond attribute (default 0)
microsecondmicrosecond attribute (default 0)
yearyear attribute
monthmonth attribute
dayday-of-month attribute