Constructors

Synopses

Declared in <bdlt_datetime.h>

Create a Datetime object whose "date" and "time" parts have their respective default‐constructed values, "0001/01/01" and "24:00:00.000000".

Create a Datetime object having the value of the specified original object.

Datetime(Datetime const& original);

Create a Datetime object whose "date" part has the value of the specified date and whose "time" part has the value "00:00:00.000000".

Datetime(Date const& date);

Create a Datetime object whose "date" and "time" parts have the values of the specified date and time, respectively.

Datetime(
    Date const& date,
    Time const& time);

Create a Datetime from year, month, day, and optional time fields.

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

Parameters

Name

Description

original

datetime whose value is copied

date

date part of the new value

time

time part of the new value

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)

microsecond

microsecond attribute (default 0)

Created with MrDocs