51Degrees Device Detection C/C++  4.1

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 ()
Get the year. More...
int  getMonth ()
Get the month. More...
int  getDay ()
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 ( )

Get the day of the month.

Returns
day of the month

◆ getMonth()

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

Get the month.

Returns
month

◆ getYear()

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

Get the year.

Returns
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