Max OS 0.3
Loading...
Searching...
No Matches
MaxOS::common::Time Struct Reference

Stores the year, month, day, hour, minute and second of a time. More...

#include <time.h>

Public Member Functions

bool is_leap_year () const
 Checks if the year is a leap year.
 

Public Attributes

uint16_t year
 The year.
 
uint8_t month
 The month (1-12)
 
uint8_t day
 The day (1-31)
 
uint8_t hour
 The hour (0-23)
 
uint8_t minute
 The minute (0-59)
 
uint8_t second
 The second (0-59)
 

Detailed Description

Stores the year, month, day, hour, minute and second of a time.

Definition at line 24 of file time.h.

Member Function Documentation

◆ is_leap_year()

bool MaxOS::common::Time::is_leap_year ( ) const
inline

Checks if the year is a leap year.

Returns
True if the year is a leap year, false otherwise

Definition at line 38 of file time.h.

38 {
39 return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;
40 }
uint16_t year
The year.
Definition time.h:26

References year.

Member Data Documentation

◆ day

uint8_t MaxOS::common::Time::day

The day (1-31)

Definition at line 28 of file time.h.

◆ hour

uint8_t MaxOS::common::Time::hour

The hour (0-23)

Definition at line 30 of file time.h.

◆ minute

uint8_t MaxOS::common::Time::minute

The minute (0-59)

Definition at line 31 of file time.h.

◆ month

uint8_t MaxOS::common::Time::month

The month (1-12)

Definition at line 27 of file time.h.

◆ second

uint8_t MaxOS::common::Time::second

The second (0-59)

Definition at line 32 of file time.h.

◆ year

uint16_t MaxOS::common::Time::year

The year.

Definition at line 26 of file time.h.

Referenced by is_leap_year().


The documentation for this struct was generated from the following file: