Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
date_time_struct.hpp
Go to the documentation of this file.
1#pragma once
6#ifndef _TIME_SHIELD_DATE_TIME_STRUCT_HPP_INCLUDED
7#define _TIME_SHIELD_DATE_TIME_STRUCT_HPP_INCLUDED
8
9namespace time_shield {
10
14 int64_t year;
15 int mon;
16 int day;
17 int hour;
18 int min;
19 int sec;
20 int ms;
21 };
22
34 int64_t year,
35 int mon = 1,
36 int day = 1,
37 int hour = 0,
38 int min = 0,
39 int sec = 0,
40 int ms = 0) {
41 DateTimeStruct date_time;
42 date_time.year = year;
43 date_time.mon = mon;
44 date_time.day = day;
45 date_time.hour = hour;
46 date_time.min = min;
47 date_time.sec = sec;
48 date_time.ms = ms;
49 return date_time;
50 }
51
52}; // namespace time_shield
53
54#endif // _TIME_SHIELD_DATE_TIME_STRUCT_HPP_INCLUDED
TIME_SHIELD_CONSTEXPR const T year(ts_t ts=ts())
Alias for get_year function.
const DateTimeStruct create_date_time_struct(int64_t year, int mon=1, int day=1, int hour=0, int min=0, int sec=0, int ms=0)
Creates a DateTimeStruct instance.
Main namespace for the Time Shield library.
Definition constants.hpp:12
Structure to represent date and time.
int ms
Millisecond component of time (0-999)
int hour
Hour component of time (0-23)
int64_t year
Year component of the date.
int day
Day component of the date (1-31).
int min
Minute component of time (0-59)
int mon
Month component of the date (1-12).
int sec
Second component of time (0-59)