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

Synopsis

Declared in <bdlt_datetime.h>

int
validateAndSetDatetime(
    int year,
    int month,
    int day,
    int hour = 0,
    int minute = 0,
    int second = 0,
    int millisecond = 0);

Description

Set the "date" part of this object's value to the specified year, month, and day, and the "time" part to the optionally specified hour, minute, second, and millisecond, if they represent a valid Datetime value, with trailing fields that are not specified set to 0. Return 0 on success, and a non‐zero value (with no effect) otherwise.

DEPRECATED: Use setDatetimeIfValid instead.

Return Value

0 on success, and a non‐zero value otherwise

Parameters

Name

Description

year

year attribute

month

month attribute

day

day‐of‐month attribute

hour

hour attribute (default 0)

minute

minute attribute (default 0)

second

second attribute (default 0)

millisecond

millisecond attribute (default 0)

Created with MrDocs