# DateTime

<a id="datetime"></a>

# DateTime

```cpp
#include <icy/datetime.h>

class DateTime
```

[Defined in src/base/include/icy/datetime.h:265](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L265)

This class represents an instant in time, expressed in years, months, days, hours, minutes, seconds and milliseconds based on the Gregorian calendar. The class is mainly useful for conversions between UTC, Julian day and Gregorian calendar dates.

The date and time stored in a [DateTime](#datetime) is always in UTC (Coordinated Universal Time) and thus independent of the timezone in effect on the system.

Conversion calculations are based on algorithms collected and described by Peter Baum at [http://vsg.cape.com/~pbaum/date/date0.htm](http://vsg.cape.com/~pbaum/date/date0.htm)

Internally, this class stores a date/time in two forms (UTC and broken down) for performance reasons. Only use this class for conversions between date/time representations. Use the [Timestamp](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#timestamp-2) class for everything else.

Notes:

* Zero is a valid year (in accordance with ISO 8601 and astronomical year numbering)
* Year zero (0) is a leap year
* Negative years (years preceding 1 BC) are not supported

For more information, please see:

* [http://en.wikipedia.org/wiki/Gregorian_Calendar](http://en.wikipedia.org/wiki/Gregorian_Calendar)
* [http://en.wikipedia.org/wiki/Julian_day](http://en.wikipedia.org/wiki/Julian_day)
* [http://en.wikipedia.org/wiki/UTC](http://en.wikipedia.org/wiki/UTC)
* [http://en.wikipedia.org/wiki/ISO_8601](http://en.wikipedia.org/wiki/ISO_8601)

## Public Methods

| Return | Name | Description |
|--------|------|-------------|
|  | [`DateTime`](#datetime-1)  | Creates a [DateTime](#datetime) for the current date and time. |
|  | [`DateTime`](#datetime-2)  | Creates a [DateTime](#datetime) for the date and time given in a [Timestamp](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#timestamp-2). |
|  | [`DateTime`](#datetime-3)  | Creates a [DateTime](#datetime) for the given Gregorian date and time. |
|  | [`DateTime`](#datetime-4)  | Creates a [DateTime](#datetime) for the given Julian day. |
|  | [`DateTime`](#datetime-5)  | Creates a [DateTime](#datetime) from an UtcTimeVal and a TimeDiff. |
|  | [`DateTime`](#datetime-6)  | Copy constructor. Creates the [DateTime](#datetime) from another one. |
|  | [`~DateTime`](#datetime-7)  | Destroys the [DateTime](#datetime). |
| [`DateTime`](#datetime) & | [`operator=`](#operator-13)  | Assigns another [DateTime](#datetime). |
| [`DateTime`](#datetime) & | [`operator=`](#operator-14)  | Assigns a [Timestamp](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#timestamp-2). |
| [`DateTime`](#datetime) & | [`operator=`](#operator-15)  | Assigns a Julian day. |
| [`DateTime`](#datetime) & | [`assign`](#assign)  | Assigns a Gregorian date and time. |
| `void` | [`swap`](#swap-4)  | Swaps the [DateTime](#datetime) with another one. |
| `int` | [`year`](#year) `const` `inline` | Returns the year. |
| `int` | [`month`](#month) `const` `inline` | Returns the month (1 to 12). |
| `int` | [`week`](#week) `const` | Returns the week number within the year. FirstDayOfWeek should be either SUNDAY (0) or MONDAY (1). The returned week number will be from 0 to 53. Week number 1 is the week containing January 4. This is in accordance to ISO 8601. |
| `int` | [`day`](#day) `const` `inline` | Returns the day witin the month (1 to 31). |
| `int` | [`dayOfWeek`](#dayofweek) `const` | Returns the weekday (0 to 6, where 0 = Sunday, 1 = Monday, ..., 6 = Saturday). |
| `int` | [`dayOfYear`](#dayofyear) `const` | Returns the number of the day in the year. January 1 is 1, February 1 is 32, etc. |
| `int` | [`hour`](#hour) `const` `inline` | Returns the hour (0 to 23). |
| `int` | [`hourAMPM`](#hourampm) `const` `inline` | Returns the hour (0 to 12). |
| `bool` | [`isAM`](#isam) `const` `inline` | Returns true if hour < 12;. |
| `bool` | [`isPM`](#ispm) `const` `inline` | Returns true if hour >= 12. |
| `int` | [`minute`](#minute) `const` `inline` | Returns the minute (0 to 59). |
| `int` | [`second`](#second) `const` `inline` | Returns the second (0 to 59). |
| `int` | [`millisecond`](#millisecond) `const` `inline` | Returns the millisecond (0 to 999) |
| `int` | [`microsecond`](#microsecond) `const` `inline` | Returns the microsecond (0 to 999) |
| `double` | [`julianDay`](#julianday) `const` | Returns the julian day for the date and time. |
| [`Timestamp`](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#timestamp-2) | [`timestamp`](#timestamp) `const` `inline` | Returns the date and time expressed as a [Timestamp](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#timestamp-2). |
| [`Timestamp::UtcTimeVal`](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#utctimeval) | [`utcTime`](#utctime) `const` `inline` | Returns the date and time expressed in UTC-based time. UTC base time is midnight, October 15, 1582. Resolution is 100 nanoseconds. |
| `bool` | [`operator==`](#operator-16) `const` `inline` |  |
| `bool` | [`operator!=`](#operator-17) `const` `inline` |  |
| `bool` | [`operator<`](#operator-18) `const` `inline` |  |
| `bool` | [`operator<=`](#operator-19) `const` `inline` |  |
| `bool` | [`operator>`](#operator-20) `const` `inline` |  |
| `bool` | [`operator>=`](#operator-21) `const` `inline` |  |
| [`DateTime`](#datetime) | [`operator+`](#operator-22) `const` |  |
| [`DateTime`](#datetime) | [`operator-`](#operator-23) `const` |  |
| [`Timespan`](https://auscaster.com/icey/docs/api-reference/icy-Timespan.md#timespan) | [`operator-`](#operator-24) `const` |  |
| [`DateTime`](#datetime) & | [`operator+=`](#operator-25)  |  |
| [`DateTime`](#datetime) & | [`operator-=`](#operator-26)  |  |
| `void` | [`makeUTC`](#makeutc)  | Converts a local time into UTC, by applying the given time zone differential. |
| `void` | [`makeLocal`](#makelocal)  | Converts a UTC time into a local time, by applying the given time zone differential. |

---

<a id="datetime-1"></a>

### DateTime

```cpp
DateTime()
```

[Defined in src/base/include/icy/datetime.h:298](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L298)

Creates a [DateTime](#datetime) for the current date and time.

---

<a id="datetime-2"></a>

### DateTime

```cpp
DateTime(const Timestamp & timestamp)
```

[Defined in src/base/include/icy/datetime.h:302](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L302)

Creates a [DateTime](#datetime) for the date and time given in a [Timestamp](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#timestamp-2).

---

<a id="datetime-3"></a>

### DateTime

```cpp
DateTime(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0)
```

[Defined in src/base/include/icy/datetime.h:313](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L313)

Creates a [DateTime](#datetime) for the given Gregorian date and time.

* year is from 0 to 9999.
* month is from 1 to 12.
* day is from 1 to 31.
* hour is from 0 to 23.
* minute is from 0 to 59.
* second is from 0 to 59.
* millisecond is from 0 to 999.
* microsecond is from 0 to 999.

---

<a id="datetime-4"></a>

### DateTime

```cpp
DateTime(double julianDay)
```

[Defined in src/base/include/icy/datetime.h:317](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L317)

Creates a [DateTime](#datetime) for the given Julian day.

---

<a id="datetime-5"></a>

### DateTime

```cpp
DateTime(Timestamp::UtcTimeVal utcTime, Timestamp::TimeDiff diff)
```

[Defined in src/base/include/icy/datetime.h:322](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L322)

Creates a [DateTime](#datetime) from an UtcTimeVal and a TimeDiff.

Mainly used internally by [DateTime](#datetime) and friends.

---

<a id="datetime-6"></a>

### DateTime

```cpp
DateTime(const DateTime & dateTime)
```

[Defined in src/base/include/icy/datetime.h:325](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L325)

Copy constructor. Creates the [DateTime](#datetime) from another one.

---

<a id="datetime-7"></a>

### ~DateTime

```cpp
~DateTime()
```

[Defined in src/base/include/icy/datetime.h:328](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L328)

Destroys the [DateTime](#datetime).

---

<a id="operator-13"></a>

### operator=

```cpp
DateTime & operator=(const DateTime & dateTime)
```

[Defined in src/base/include/icy/datetime.h:331](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L331)

Assigns another [DateTime](#datetime).

---

<a id="operator-14"></a>

### operator=

```cpp
DateTime & operator=(const Timestamp & timestamp)
```

[Defined in src/base/include/icy/datetime.h:334](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L334)

Assigns a [Timestamp](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#timestamp-2).

---

<a id="operator-15"></a>

### operator=

```cpp
DateTime & operator=(double julianDay)
```

[Defined in src/base/include/icy/datetime.h:337](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L337)

Assigns a Julian day.

---

<a id="assign"></a>

### assign

```cpp
DateTime & assign(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microseconds = 0)
```

[Defined in src/base/include/icy/datetime.h:348](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L348)

Assigns a Gregorian date and time.

* year is from 0 to 9999.
* month is from 1 to 12.
* day is from 1 to 31.
* hour is from 0 to 23.
* minute is from 0 to 59.
* second is from 0 to 59.
* millisecond is from 0 to 999.
* microsecond is from 0 to 999.

---

<a id="swap-4"></a>

### swap

```cpp
void swap(DateTime & dateTime)
```

[Defined in src/base/include/icy/datetime.h:352](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L352)

Swaps the [DateTime](#datetime) with another one.

---

<a id="year"></a>

### year

`const` `inline`

```cpp
inline int year() const
```

[Defined in src/base/include/icy/datetime.h:355](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L355)

Returns the year.

---

<a id="month"></a>

### month

`const` `inline`

```cpp
inline int month() const
```

[Defined in src/base/include/icy/datetime.h:358](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L358)

Returns the month (1 to 12).

---

<a id="week"></a>

### week

`const`

```cpp
int week(int firstDayOfWeek = MONDAY) const
```

[Defined in src/base/include/icy/datetime.h:374](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L374)

Returns the week number within the year. FirstDayOfWeek should be either SUNDAY (0) or MONDAY (1). The returned week number will be from 0 to 53. Week number 1 is the week containing January 4. This is in accordance to ISO 8601.

The following example assumes that firstDayOfWeek is MONDAY. For 2005, which started on a Saturday, week 1 will be the week starting on Monday, January 3. January 1 and 2 will fall within week 0 (or the last week of the previous year).

For 2007, which starts on a Monday, week 1 will be the week startung on Monday, January 1. There will be no week 0 in 2007.

---

<a id="day"></a>

### day

`const` `inline`

```cpp
inline int day() const
```

[Defined in src/base/include/icy/datetime.h:377](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L377)

Returns the day witin the month (1 to 31).

---

<a id="dayofweek"></a>

### dayOfWeek

`const`

```cpp
int dayOfWeek() const
```

[Defined in src/base/include/icy/datetime.h:381](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L381)

Returns the weekday (0 to 6, where 0 = Sunday, 1 = Monday, ..., 6 = Saturday).

---

<a id="dayofyear"></a>

### dayOfYear

`const`

```cpp
int dayOfYear() const
```

[Defined in src/base/include/icy/datetime.h:385](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L385)

Returns the number of the day in the year. January 1 is 1, February 1 is 32, etc.

---

<a id="hour"></a>

### hour

`const` `inline`

```cpp
inline int hour() const
```

[Defined in src/base/include/icy/datetime.h:388](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L388)

Returns the hour (0 to 23).

---

<a id="hourampm"></a>

### hourAMPM

`const` `inline`

```cpp
inline int hourAMPM() const
```

[Defined in src/base/include/icy/datetime.h:391](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L391)

Returns the hour (0 to 12).

---

<a id="isam"></a>

### isAM

`const` `inline`

```cpp
inline bool isAM() const
```

[Defined in src/base/include/icy/datetime.h:394](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L394)

Returns true if hour < 12;.

---

<a id="ispm"></a>

### isPM

`const` `inline`

```cpp
inline bool isPM() const
```

[Defined in src/base/include/icy/datetime.h:397](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L397)

Returns true if hour >= 12.

---

<a id="minute"></a>

### minute

`const` `inline`

```cpp
inline int minute() const
```

[Defined in src/base/include/icy/datetime.h:400](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L400)

Returns the minute (0 to 59).

---

<a id="second"></a>

### second

`const` `inline`

```cpp
inline int second() const
```

[Defined in src/base/include/icy/datetime.h:403](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L403)

Returns the second (0 to 59).

---

<a id="millisecond"></a>

### millisecond

`const` `inline`

```cpp
inline int millisecond() const
```

[Defined in src/base/include/icy/datetime.h:406](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L406)

Returns the millisecond (0 to 999)

---

<a id="microsecond"></a>

### microsecond

`const` `inline`

```cpp
inline int microsecond() const
```

[Defined in src/base/include/icy/datetime.h:409](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L409)

Returns the microsecond (0 to 999)

---

<a id="julianday"></a>

### julianDay

`const`

```cpp
double julianDay() const
```

[Defined in src/base/include/icy/datetime.h:412](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L412)

Returns the julian day for the date and time.

---

<a id="timestamp"></a>

### timestamp

`const` `inline`

```cpp
inline Timestamp timestamp() const
```

[Defined in src/base/include/icy/datetime.h:415](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L415)

Returns the date and time expressed as a [Timestamp](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#timestamp-2).

---

<a id="utctime"></a>

### utcTime

`const` `inline`

```cpp
inline Timestamp::UtcTimeVal utcTime() const
```

[Defined in src/base/include/icy/datetime.h:420](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L420)

Returns the date and time expressed in UTC-based time. UTC base time is midnight, October 15, 1582. Resolution is 100 nanoseconds.

---

<a id="operator-16"></a>

### operator==

`const` `inline`

```cpp
inline bool operator==(const DateTime & dateTime) const
```

[Defined in src/base/include/icy/datetime.h:422](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L422)

---

<a id="operator-17"></a>

### operator!=

`const` `inline`

```cpp
inline bool operator!=(const DateTime & dateTime) const
```

[Defined in src/base/include/icy/datetime.h:423](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L423)

---

<a id="operator-18"></a>

### operator<

`const` `inline`

```cpp
inline bool operator<(const DateTime & dateTime) const
```

[Defined in src/base/include/icy/datetime.h:424](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L424)

---

<a id="operator-19"></a>

### operator<=

`const` `inline`

```cpp
inline bool operator<=(const DateTime & dateTime) const
```

[Defined in src/base/include/icy/datetime.h:425](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L425)

---

<a id="operator-20"></a>

### operator>

`const` `inline`

```cpp
inline bool operator>(const DateTime & dateTime) const
```

[Defined in src/base/include/icy/datetime.h:426](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L426)

---

<a id="operator-21"></a>

### operator>=

`const` `inline`

```cpp
inline bool operator>=(const DateTime & dateTime) const
```

[Defined in src/base/include/icy/datetime.h:427](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L427)

---

<a id="operator-22"></a>

### operator+

`const`

```cpp
DateTime operator+(const Timespan & span) const
```

[Defined in src/base/include/icy/datetime.h:429](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L429)

---

<a id="operator-23"></a>

### operator-

`const`

```cpp
DateTime operator-(const Timespan & span) const
```

[Defined in src/base/include/icy/datetime.h:430](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L430)

---

<a id="operator-24"></a>

### operator-

`const`

```cpp
Timespan operator-(const DateTime & dateTime) const
```

[Defined in src/base/include/icy/datetime.h:431](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L431)

---

<a id="operator-25"></a>

### operator+=

```cpp
DateTime & operator+=(const Timespan & span)
```

[Defined in src/base/include/icy/datetime.h:432](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L432)

---

<a id="operator-26"></a>

### operator-=

```cpp
DateTime & operator-=(const Timespan & span)
```

[Defined in src/base/include/icy/datetime.h:433](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L433)

---

<a id="makeutc"></a>

### makeUTC

```cpp
void makeUTC(int tzd)
```

[Defined in src/base/include/icy/datetime.h:437](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L437)

Converts a local time into UTC, by applying the given time zone differential.

---

<a id="makelocal"></a>

### makeLocal

```cpp
void makeLocal(int tzd)
```

[Defined in src/base/include/icy/datetime.h:441](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L441)

Converts a UTC time into a local time, by applying the given time zone differential.

## Public Static Methods

| Return | Name | Description |
|--------|------|-------------|
| `bool` | [`isLeapYear`](#isleapyear) `static` `inline` | Returns true if the given year is a leap year; false otherwise. |
| `int` | [`daysOfMonth`](#daysofmonth) `static` | Returns the number of days in the given month and year. Month is from 1 to 12. |
| `bool` | [`isValid`](#isvalid) `static` | Checks if the given date and time is valid (all arguments are within a proper range). |

---

<a id="isleapyear"></a>

### isLeapYear

`static` `inline`

```cpp
static inline bool isLeapYear(int year)
```

[Defined in src/base/include/icy/datetime.h:445](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L445)

Returns true if the given year is a leap year; false otherwise.

---

<a id="daysofmonth"></a>

### daysOfMonth

`static`

```cpp
static int daysOfMonth(int year, int month)
```

[Defined in src/base/include/icy/datetime.h:449](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L449)

Returns the number of days in the given month and year. Month is from 1 to 12.

---

<a id="isvalid"></a>

### isValid

`static`

```cpp
static bool isValid(int year, int month, int day, int hour = 0, int minute = 0, int second = 0, int millisecond = 0, int microsecond = 0)
```

[Defined in src/base/include/icy/datetime.h:455](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L455)

Checks if the given date and time is valid (all arguments are within a proper range).

Returns true if all arguments are valid, false otherwise.

## Protected Methods

| Return | Name | Description |
|--------|------|-------------|
| `void` | [`computeGregorian`](#computegregorian)  | Computes the Gregorian date for the given Julian day. See [http://vsg.cape.com/~pbaum/date/injdimp.htm](http://vsg.cape.com/~pbaum/date/injdimp.htm), section 3.3.1 for the algorithm. |
| `void` | [`computeDaytime`](#computedaytime)  | Extracts the daytime (hours, minutes, seconds, etc.) from the stored utcTime. |

---

<a id="computegregorian"></a>

### computeGregorian

```cpp
void computeGregorian(double julianDay)
```

[Defined in src/base/include/icy/datetime.h:477](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L477)

Computes the Gregorian date for the given Julian day. See [http://vsg.cape.com/~pbaum/date/injdimp.htm](http://vsg.cape.com/~pbaum/date/injdimp.htm), section 3.3.1 for the algorithm.

---

<a id="computedaytime"></a>

### computeDaytime

```cpp
void computeDaytime()
```

[Defined in src/base/include/icy/datetime.h:481](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L481)

Extracts the daytime (hours, minutes, seconds, etc.) from the stored utcTime.

## Public Types

| Name | Description |
|------|-------------|
| [`Months`](#months)  | Symbolic names for month numbers (1 to 12). |
| [`DaysOfWeek`](#daysofweek)  | Symbolic names for week day numbers (0 to 6). |

---

<a id="months"></a>

### Months

```cpp
enum Months
```

[Defined in src/base/include/icy/datetime.h:269](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L269)

Symbolic names for month numbers (1 to 12).

| Value | Description |
|-------|-------------|
| `JANUARY` |  |
| `FEBRUARY` |  |
| `MARCH` |  |
| `APRIL` |  |
| `MAY` |  |
| `JUNE` |  |
| `JULY` |  |
| `AUGUST` |  |
| `SEPTEMBER` |  |
| `OCTOBER` |  |
| `NOVEMBER` |  |
| `DECEMBER` |  |

---

<a id="daysofweek"></a>

### DaysOfWeek

```cpp
enum DaysOfWeek
```

[Defined in src/base/include/icy/datetime.h:286](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L286)

Symbolic names for week day numbers (0 to 6).

| Value | Description |
|-------|-------------|
| `SUNDAY` |  |
| `MONDAY` |  |
| `TUESDAY` |  |
| `WEDNESDAY` |  |
| `THURSDAY` |  |
| `FRIDAY` |  |
| `SATURDAY` |  |
## Private Attributes

| Return | Name | Description |
|--------|------|-------------|
| [`Timestamp::UtcTimeVal`](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#utctimeval) | [`_utcTime`](#_utctime)  |  |
| `short` | [`_year`](#_year)  |  |
| `short` | [`_month`](#_month)  |  |
| `short` | [`_day`](#_day)  |  |
| `short` | [`_hour`](#_hour)  |  |
| `short` | [`_minute`](#_minute)  |  |
| `short` | [`_second`](#_second)  |  |
| `short` | [`_millisecond`](#_millisecond)  |  |
| `short` | [`_microsecond`](#_microsecond)  |  |

---

<a id="_utctime"></a>

### _utcTime

```cpp
Timestamp::UtcTimeVal _utcTime
```

Type: [`Timestamp::UtcTimeVal`](https://auscaster.com/icey/docs/api-reference/icy-Timestamp.md#utctimeval)

[Defined in src/base/include/icy/datetime.h:488](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L488)

---

<a id="_year"></a>

### _year

```cpp
short _year
```

[Defined in src/base/include/icy/datetime.h:489](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L489)

---

<a id="_month"></a>

### _month

```cpp
short _month
```

[Defined in src/base/include/icy/datetime.h:490](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L490)

---

<a id="_day"></a>

### _day

```cpp
short _day
```

[Defined in src/base/include/icy/datetime.h:491](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L491)

---

<a id="_hour"></a>

### _hour

```cpp
short _hour
```

[Defined in src/base/include/icy/datetime.h:492](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L492)

---

<a id="_minute"></a>

### _minute

```cpp
short _minute
```

[Defined in src/base/include/icy/datetime.h:493](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L493)

---

<a id="_second"></a>

### _second

```cpp
short _second
```

[Defined in src/base/include/icy/datetime.h:494](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L494)

---

<a id="_millisecond"></a>

### _millisecond

```cpp
short _millisecond
```

[Defined in src/base/include/icy/datetime.h:495](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L495)

---

<a id="_microsecond"></a>

### _microsecond

```cpp
short _microsecond
```

[Defined in src/base/include/icy/datetime.h:496](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L496)

## Private Methods

| Return | Name | Description |
|--------|------|-------------|
| `void` | [`checkLimit`](#checklimit)  | Utility functions used to correct the overflow in computeGregorian. |
| `void` | [`normalize`](#normalize)  |  |

---

<a id="checklimit"></a>

### checkLimit

```cpp
void checkLimit(short & lower, short & higher, short limit)
```

[Defined in src/base/include/icy/datetime.h:485](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L485)

Utility functions used to correct the overflow in computeGregorian.

---

<a id="normalize"></a>

### normalize

```cpp
void normalize()
```

[Defined in src/base/include/icy/datetime.h:486](https://github.com/auscaster/icey/blob/main/src/base/include/icy/datetime.h#L486)
