Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
time_struct.hpp
Go to the documentation of this file.
1#pragma once
6#ifndef _TIME_SHIELD_TIME_STRUCT_HPP_INCLUDED
7#define _TIME_SHIELD_TIME_STRUCT_HPP_INCLUDED
8
9namespace time_shield {
10
13 struct TimeStruct {
14 int16_t hour;
15 int16_t min;
16 int16_t sec;
17 int16_t ms;
18 };
19
28 int16_t hour,
29 int16_t min,
30 int16_t sec = 0,
31 int16_t ms = 0) {
32 TimeStruct data{hour, min, sec, ms};
33 return data;
34 }
35
36}; // namespace time_shield
37
38#endif // _TIME_SHIELD_TIME_STRUCT_HPP_INCLUDED
const TimeStruct create_time_struct(int16_t hour, int16_t min, int16_t sec=0, int16_t ms=0)
Creates a TimeStruct instance.
Main namespace for the Time Shield library.
Definition constants.hpp:12
Structure to represent time.
int16_t ms
Millisecond component of time (0-999)
int16_t hour
Hour component of time (0-23)
int16_t sec
Second component of time (0-59)
int16_t min
Minute component of time (0-59)