Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the develop branch, built from commit 3785d1f795.
PrevUpHomeNext

date

Type representing MySQL DATE data type.

Synopsis

Defined in header <boost/mysql/date.hpp>

class date
Types

Name

Description

time_point

A std::chrono::time_point that can represent any valid date.

Member Functions

Name

Description

as_time_point

Converts *this into a time_point (checked access).

date [constructor]

Constructs a zero date.

Constructs a date from its year, month and date components.

Constructs a date from a time_point.

day

Retrieves the day component.

get_time_point

Converts *this into a time_point (unchecked access).

month

Retrieves the month component.

operator==

Tests for equality.

operator!=

Tests for inequality.

valid

Returns true if *this represents a valid time_point.

year

Retrieves the year component.

Static Member Functions

Name

Description

now

Returns the current system time as a date object.

Related Functions

Name

Description

operator<<

Streams a date.

Description

Represents a broken date by its year, month and day components. This type is close to the protocol and should not be used as a vocabulary type. Instead, cast it to a std::chrono::time_point by calling as_time_point or get_time_point.

As opposed to time_point, this type allows representing invalid and zero dates.


PrevUpHomeNext