---
name: "Date"
section: "3cc"
platform: "linux"
package: "libcommoncpp2-dev"
version: "1.0.13-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/Date"
---

# Date(3cc)

The Date class uses a julian date representation of the current year, month, and day. julian number based date class.

## NAME

Date - The Date class uses a julian date representation of the current year, month, and day. julian number based date class.

## SYNOPSIS

`#include <numbers.h>`

Inherited by **DateNumber**, and **Datetime**.

### Public Methods

**Date** (time\_t tm)\
 **Date** (tm \*dt)\
 **Date** (char \*str, size\_t **size**=0)\
 **Date** (int year, unsigned month, unsigned day)\
 **Date** ()\
 int **getYear** (void) const\
 unsigned **getMonth** (void) const\
 unsigned **getDay** (void) const\
 unsigned **getDayOfWeek** (void) const\
 char \* **getDate** (char \*buffer) const\
 time\_t **getDate** (void) const\
 time\_t **getDate** (tm \*buf) const\
 long **getValue** (void) const\
 void **setDate** (const char \*str, size\_t **size**=0)\
 bool **isValid** (void) const\
 **operator long** () const\
 std::string **operator()** () const\
 Date & **operator++** ()\
 Date & **operator--** ()\
 Date & **operator+=** (long val)\
 Date & **operator-=** (long val)\
 int **operator==** (Date &date)\
 int **operator!=** (Date &date)\
 int **operator\<** (Date &date)\
 int **operator\<=** (Date &date)\
 int **operator\>** (Date &date)\
 int **operator\>=** (Date &date)\
 bool **operator!** () const\

### Protected Methods

void **toJulian** (long year, long month, long day)\
 void **fromJulian** (char \*buf) const\
 virtual void **update** (void)\
 *A method to use to 'post' any changed values when shadowing a mixed object class.*

### Protected Attributes

long **julian**\

### Friends

Date **operator+** (Date &date, long val)\
 Date **operator-** (Date &date, long val)\
 Date **operator+** (long val, Date &date)\
 Date **operator-** (long val, Date &date)\

## DETAILED DESCRIPTION

The Date class uses a julian date representation of the current year, month, and day. julian number based date class.

This is then manipulated in several forms and may be exported as needed.

**Author:**  David Sugar \<dyfet@ostel.com\>

## CONSTRUCTOR & DESTRUCTOR DOCUMENTATION

### Date::Date (time\_t tm)

### Date::Date (tm \* dt)

### Date::Date (char \* str, size\_t size = 0)

### Date::Date (int year, unsigned month, unsigned day)

### Date::Date ()

## MEMBER FUNCTION DOCUMENTATION

### void Date::fromJulian (char \* buf) const` [protected]`

### time\_t Date::getDate (tm \* buf) const

### time\_t Date::getDate (void) const

### char\* Date::getDate (char \* buffer) const

### unsigned Date::getDay (void) const

### unsigned Date::getDayOfWeek (void) const

### unsigned Date::getMonth (void) const

### long Date::getValue (void) const

### int Date::getYear (void) const

### bool Date::isValid (void) const

Reimplemented in **Datetime**.

### Date::operator long () const` [inline]`

### bool Date::operator! (void) const` [inline]`

### int Date::operator!= (Date & date)

### std::string Date::operator() ()

### Date& Date::operator++ ()

### Date& Date::operator+= (long val)

### Date& Date::operator-- ()

### Date& Date::operator-= (long val)

### int Date::operator\< (Date & date)

### int Date::operator\<= (Date & date)

### int Date::operator== (Date & date)

### int Date::operator\> (Date & date)

### int Date::operator\>= (Date & date)

### void Date::setDate (const char \* str, size\_t size = 0)

### void Date::toJulian (long year, long month, long day)` [protected]`

### virtual void Date::update (void)` [inline, protected, virtual]`

A method to use to 'post' any changed values when shadowing a mixed object class.

This is used by **DateNumber**.

Reimplemented in **DateNumber**.

## FRIENDS AND RELATED FUNCTION DOCUMENTATION

### Date operator+ (long val, Date & date)` [friend]`

### Date operator+ (Date & date, long val)` [friend]`

### Date operator- (long val, Date & date)` [friend]`

### Date operator- (Date & date, long val)` [friend]`

## MEMBER DATA DOCUMENTATION

### long Date::julian` [protected]`

## AUTHOR

Generated automatically by Doxygen for CommonC++ from the source code.
