51Degrees Device Detection C/C++  4.3

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


 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...


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.

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.

day of the month

◆ getMonth()

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

Get the month.


◆ getYear()

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

Get the year.


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