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

# Datetime(3cc)

The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time. Integer based time class.

## NAME

Datetime - The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time. Integer based time class.

## SYNOPSIS

`#include <numbers.h>`

Inherits **Date**, and **Time**.

### Public Methods

**Datetime** (time\_t tm)\
 **Datetime** (tm \*dt)\
 **Datetime** (char \*str, size\_t **size**=0)\
 **Datetime** (int year, unsigned month, unsigned day, int hour, int minute, int second)\
 **Datetime** ()\
 char \* **getDatetime** (char \*buffer) const\
 time\_t **getDatetime** (void) const\
 bool **isValid** (void) const\
 Datetime & **operator=** (Datetime datetime)\
 Datetime & **operator+=** (Datetime &datetime)\
 Datetime & **operator-=** (Datetime &datetime)\
 Datetime & **operator+=** (**Time** &time)\
 Datetime & **operator-=** (**Time** &time)\
 int **operator==** (Datetime &)\
 int **operator!=** (Datetime &)\
 int **operator\<** (Datetime &)\
 int **operator\<=** (Datetime &)\
 int **operator\>** (Datetime &)\
 int **operator\>=** (Datetime &)\
 bool **operator!** ()\
 std::string **strftime** (const char \*format) const\

## DETAILED DESCRIPTION

The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time. Integer based time class.

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

**Author:**  Marcelo Dalmas \<mad@brasmap.com.br\>

## CONSTRUCTOR & DESTRUCTOR DOCUMENTATION

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

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

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

### Datetime::Datetime (int year, unsigned month, unsigned day, int hour, int minute, int second)

### Datetime::Datetime ()

## MEMBER FUNCTION DOCUMENTATION

### time\_t Datetime::getDatetime (void) const

### char\* Datetime::getDatetime (char \* buffer) const

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

Reimplemented from **Date**.

### bool Datetime::operator! ()

Reimplemented from **Time**.

### int Datetime::operator!= (Datetime &)

### Datetime& Datetime::operator+= (Time & time)

### Datetime& Datetime::operator+= (Datetime & datetime)

### Datetime& Datetime::operator-= (Time & time)

### Datetime& Datetime::operator-= (Datetime & datetime)

### int Datetime::operator\< (Datetime &)

### int Datetime::operator\<= (Datetime &)

### Datetime& Datetime::operator= (Datetime datetime)

### int Datetime::operator== (Datetime &)

### int Datetime::operator\> (Datetime &)

### int Datetime::operator\>= (Datetime &)

### std::string Datetime::strftime (const char \* format) const

## AUTHOR

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