Max OS 0.3
Loading...
Searching...
No Matches
time.h File Reference

Defines a Time struct for storing date and time information, along with functions for time manipulation. More...

#include <cstdint>

Go to the source code of this file.

Classes

struct  MaxOS::common::Time
 Stores the year, month, day, hour, minute and second of a time. More...
 

Typedefs

typedef struct MaxOS::common::Time MaxOS::common::time_t
 Alias for Time struct.
 

Variables

constexpr uint8_t MaxOS::common::DAYS_IN_MONTH []
 Number of days in each month indexed by month number - 1.
 
constexpr uint16_t MaxOS::common::DAYS_PER_YEAR = 365
 Number of days in a non-leap year.
 
constexpr uint16_t MaxOS::common::DAYS_PER_LEAP_YEAR = 366
 Number of days in a leap year.
 

Detailed Description

Defines a Time struct for storing date and time information, along with functions for time manipulation.

Date
10th April 2023
Author
Max Tyson

Definition in file time.h.

Variable Documentation

◆ DAYS_IN_MONTH

constexpr uint8_t MaxOS::common::DAYS_IN_MONTH[]
constexpr
Initial value:
= {
31,
28,
31,
30,
31,
30,
31,
31,
30,
31,
30,
31
}

Number of days in each month indexed by month number - 1.

Definition at line 72 of file time.h.

72 {
73 31, // January
74 28, // February
75 31, // March
76 30, // April
77 31, // May
78 30, // June
79 31, // July
80 31, // August
81 30, // September
82 31, // October
83 30, // November
84 31 // December
85 };

◆ DAYS_PER_LEAP_YEAR

constexpr uint16_t MaxOS::common::DAYS_PER_LEAP_YEAR = 366
constexpr

Number of days in a leap year.

Definition at line 88 of file time.h.

◆ DAYS_PER_YEAR

constexpr uint16_t MaxOS::common::DAYS_PER_YEAR = 365
constexpr

Number of days in a non-leap year.

Definition at line 87 of file time.h.