\r\n

51Degrees Device Detection C/C++  4.4

A device detection library that is used natively or by 51Degrees products

FiftyoneDegrees::Common::Date Class Reference

Detailed Description

The Date class wraps the C fiftyoneDegreesDate structure and is used to represent dates in engines.

This is a memory efficient way to store a date.

Usage Example

std::stringstream stream;
// Format a string representation of a date in the format DD/MM/YYY
stream << date->getDay() << "/"
<< date->getMonth() << "/"
<< date->getYear();
string dateString = stream.str();

Public Member Functions

Constructors

 Date ()
Construct a "null" date with year, month and day all set to zero.
 Date (const fiftyoneDegreesDate *date)
Construct a date from a C date structure. More...

Getters

int  getYear () const
Get the year. More...
int  getMonth () const
Get the month. More...
int  getDay () const
Get the day of the month. More...

Constructor & Destructor Documentation

◆ Date()

FiftyoneDegrees::Common::Date::Date ( const fiftyoneDegreesDate *   date )

Construct a date from a C date structure.

This copies the date date structure so the argument can be freed after construction.

Parameters
date - pointer to copy to the underlying date structure

Member Function Documentation

◆ getDay()

int FiftyoneDegrees::Common::Date::getDay ( ) const

Get the day of the month.

Returns
day of the month

◆ getMonth()

int FiftyoneDegrees::Common::Date::getMonth ( ) const

Get the month.

Returns
month

◆ getYear()

int FiftyoneDegrees::Common::Date::getYear ( ) const

Get the year.

Returns
year

The documentation for this class was generated from the following file:
  • /home/runner/work/device-detection-cxx/device-detection-cxx/common/device-detection-cxx/src/common-cxx/Date.hpp