\hypertarget{time_8h}{}\doxysubsection{time.\+h File Reference}
\label{time_8h}\index{time.h@{time.h}}
\doxysubsubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structtm}{tm}}
\item 
struct \mbox{\hyperlink{structweek__date}{week\+\_\+date}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{time_8h_ae8dbeb3eda9f88f8f222adea789ec63d}{O\+N\+E\+\_\+\+H\+O\+UR}}~3600
\item 
\#define \mbox{\hyperlink{time_8h_a33af778316d8cac3769692c311825a52}{O\+N\+E\+\_\+\+D\+E\+G\+R\+EE}}~3600
\item 
\#define \mbox{\hyperlink{time_8h_a44eb26d33eb6c5e235c6cbfa377f60ae}{O\+N\+E\+\_\+\+D\+AY}}~86400
\item 
\#define \mbox{\hyperlink{time_8h_a0643a5b723dde6420363401dffc2e67e}{U\+N\+I\+X\+\_\+\+O\+F\+F\+S\+ET}}~946684800
\item 
\#define \mbox{\hyperlink{time_8h_aa7c3e93bff90674e9e74de6bdec85613}{N\+T\+P\+\_\+\+O\+F\+F\+S\+ET}}~3155673600
\end{DoxyCompactItemize}
\doxysubsubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef \mbox{\hyperlink{group__avr__stdint_ga33594304e786b158f3fb30289278f5af}{uint32\+\_\+t}} \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}}
\end{DoxyCompactItemize}
\doxysubsubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \mbox{\hyperlink{time_8h_ae6535271b8e2884a9ed9fe92ecfd87e1}{\+\_\+\+W\+E\+E\+K\+\_\+\+D\+A\+Y\+S\+\_\+}} \{ \newline
{\bfseries S\+U\+N\+D\+AY}, 
{\bfseries M\+O\+N\+D\+AY}, 
{\bfseries T\+U\+E\+S\+D\+AY}, 
{\bfseries W\+E\+D\+N\+E\+S\+D\+AY}, 
\newline
{\bfseries T\+H\+U\+R\+S\+D\+AY}, 
{\bfseries F\+R\+I\+D\+AY}, 
{\bfseries S\+A\+T\+U\+R\+D\+AY}
 \}
\item 
enum \mbox{\hyperlink{time_8h_a9ea260b185fe2c5bb23c64f5954c28aa}{\+\_\+\+M\+O\+N\+T\+H\+S\+\_\+}} \{ \newline
{\bfseries J\+A\+N\+U\+A\+RY}, 
{\bfseries F\+E\+B\+R\+U\+A\+RY}, 
{\bfseries M\+A\+R\+CH}, 
{\bfseries A\+P\+R\+IL}, 
\newline
{\bfseries M\+AY}, 
{\bfseries J\+U\+NE}, 
{\bfseries J\+U\+LY}, 
{\bfseries A\+U\+G\+U\+ST}, 
\newline
{\bfseries S\+E\+P\+T\+E\+M\+B\+ER}, 
{\bfseries O\+C\+T\+O\+B\+ER}, 
{\bfseries N\+O\+V\+E\+M\+B\+ER}, 
{\bfseries D\+E\+C\+E\+M\+B\+ER}
 \}
\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} \mbox{\hyperlink{time_8h_a26c7d1dbf93fa8c23c5effbacec91f8c}{time}} (\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
\mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}} \mbox{\hyperlink{time_8h_a1732c46d47837951d399755899af5240}{difftime}} (\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} time1, \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} time0)
\item 
\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} \mbox{\hyperlink{time_8h_ae114b9ba0fce4e2d6297e0e66768bb75}{mktime}} (struct \mbox{\hyperlink{structtm}{tm}} $\ast$timeptr)
\item 
\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} \mbox{\hyperlink{time_8h_ab687d0e66f0c74b9723ff9c718ea57da}{mk\+\_\+gmtime}} (const struct \mbox{\hyperlink{structtm}{tm}} $\ast$timeptr)
\item 
struct \mbox{\hyperlink{structtm}{tm}} $\ast$ \mbox{\hyperlink{time_8h_ae76343d6a51c93b9318ac0ced05225cd}{gmtime}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
void \mbox{\hyperlink{time_8h_a7cb461118a6aeebeaacd48ee127b952a}{gmtime\+\_\+r}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer, struct \mbox{\hyperlink{structtm}{tm}} $\ast$timeptr)
\item 
struct \mbox{\hyperlink{structtm}{tm}} $\ast$ \mbox{\hyperlink{time_8h_aa9336f97d394e8e02d97b9ff4fb0aca2}{localtime}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
void \mbox{\hyperlink{time_8h_acd9715002deaf28b432a8f2b54dd9aa5}{localtime\+\_\+r}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer, struct \mbox{\hyperlink{structtm}{tm}} $\ast$timeptr)
\item 
char $\ast$ \mbox{\hyperlink{time_8h_a68a0e9d22417dfcf9c0be64261352e64}{asctime}} (const struct \mbox{\hyperlink{structtm}{tm}} $\ast$timeptr)
\item 
void \mbox{\hyperlink{time_8h_aa1128e048925e3b208213febb8573b88}{asctime\+\_\+r}} (const struct \mbox{\hyperlink{structtm}{tm}} $\ast$timeptr, char $\ast$buf)
\item 
char $\ast$ \mbox{\hyperlink{time_8h_a72a5383fadfbaa033ac36e9e45b0bd6d}{ctime}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
void \mbox{\hyperlink{time_8h_a34fa7766f6b0a8a74a41683693eabad9}{ctime\+\_\+r}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer, char $\ast$buf)
\item 
char $\ast$ \mbox{\hyperlink{time_8h_a1a85cae701479294885ec9f3c6b2fade}{isotime}} (const struct \mbox{\hyperlink{structtm}{tm}} $\ast$tmptr)
\item 
void \mbox{\hyperlink{time_8h_ae200cfc8cc7309d0ce5fef3ee490dc47}{isotime\+\_\+r}} (const struct \mbox{\hyperlink{structtm}{tm}} $\ast$, char $\ast$)
\item 
size\+\_\+t \mbox{\hyperlink{time_8h_aa0344a18cbf5cfc45ffdf43890eac51c}{strftime}} (char $\ast$s, size\+\_\+t maxsize, const char $\ast$format, const struct \mbox{\hyperlink{structtm}{tm}} $\ast$timeptr)
\item 
void \mbox{\hyperlink{time_8h_a3b0c7666163850cc95f0f231f388eb2c}{set\+\_\+dst}} (int($\ast$)(const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$, \mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}} $\ast$))
\item 
void \mbox{\hyperlink{time_8h_ab4c127c1405b775b6d25a610d3fc26c3}{set\+\_\+zone}} (\mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}})
\item 
void \mbox{\hyperlink{time_8h_a02663b926feab893c0e0ec1f29b3c315}{set\+\_\+system\+\_\+time}} (\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} timestamp)
\item 
void \mbox{\hyperlink{time_8h_a15aea81a8985a4c3cc9c8b00a06f5d31}{system\+\_\+tick}} (void)
\item 
\mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} \mbox{\hyperlink{time_8h_a70762b48818b0b5bfde86973cbdd6c86}{is\+\_\+leap\+\_\+year}} (\mbox{\hyperlink{group__avr__stdint_ga932e6ccc3d54c58f761c1aead83bd6d7}{int16\+\_\+t}} year)
\item 
\mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} \mbox{\hyperlink{time_8h_aa743162fd5cbcbaf67371785e812436a}{month\+\_\+length}} (\mbox{\hyperlink{group__avr__stdint_ga932e6ccc3d54c58f761c1aead83bd6d7}{int16\+\_\+t}} year, \mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} month)
\item 
\mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} \mbox{\hyperlink{time_8h_a6e351ab03dbd6cb078dd48d1f40b9133}{week\+\_\+of\+\_\+year}} (const struct \mbox{\hyperlink{structtm}{tm}} $\ast$timeptr, \mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} start)
\item 
\mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} \mbox{\hyperlink{time_8h_a53e37af6d547a0afa624fc2230c8db7a}{week\+\_\+of\+\_\+month}} (const struct \mbox{\hyperlink{structtm}{tm}} $\ast$timeptr, \mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} start)
\item 
struct \mbox{\hyperlink{structweek__date}{week\+\_\+date}} $\ast$ \mbox{\hyperlink{time_8h_afe4b12d1be1149c088d61c7cddc945e5}{iso\+\_\+week\+\_\+date}} (int year, int yday)
\item 
void \mbox{\hyperlink{time_8h_a8a4fd6a03c19f96f656316eba80b9c9a}{iso\+\_\+week\+\_\+date\+\_\+r}} (int year, int yday, struct \mbox{\hyperlink{structweek__date}{week\+\_\+date}} $\ast$)
\item 
\mbox{\hyperlink{group__avr__stdint_ga33594304e786b158f3fb30289278f5af}{uint32\+\_\+t}} \mbox{\hyperlink{time_8h_a0e2cda2d867a784b4dfc938ad56bb94f}{fatfs\+\_\+time}} (const struct \mbox{\hyperlink{structtm}{tm}} $\ast$timeptr)
\item 
void \mbox{\hyperlink{time_8h_a90f87ccc97456fe3dcd867ccf71538ee}{set\+\_\+position}} (\mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}} latitude, \mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}} longitude)
\item 
\mbox{\hyperlink{group__avr__stdint_ga932e6ccc3d54c58f761c1aead83bd6d7}{int16\+\_\+t}} \mbox{\hyperlink{time_8h_a633438d79d5dd6f946c8b6ca4ee32111}{equation\+\_\+of\+\_\+time}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
\mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}} \mbox{\hyperlink{time_8h_a71762e360eaab527a334d9114f68aa21}{daylight\+\_\+seconds}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} \mbox{\hyperlink{time_8h_a35cf3a10ed003c844c54b7185fdb5b8a}{solar\+\_\+noon}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} \mbox{\hyperlink{time_8h_a21a491a92bce972d041e2194b4577943}{sun\+\_\+rise}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} \mbox{\hyperlink{time_8h_a0865e7b9f075981fafaabd0964de2d7f}{sun\+\_\+set}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
double \mbox{\hyperlink{time_8h_a34ba5295b14e45cef7f99c386fff0230}{solar\+\_\+declination}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
\mbox{\hyperlink{group__avr__stdint_gaef44329758059c91c76d334e8fc09700}{int8\+\_\+t}} \mbox{\hyperlink{time_8h_a6a79f1da4cd50f398a05679cddc3fede}{moon\+\_\+phase}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
unsigned long \mbox{\hyperlink{time_8h_aae725f7944578bf948bb5c44588b7b7c}{gm\+\_\+sidereal}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\item 
unsigned long \mbox{\hyperlink{time_8h_a9136313e476a6277cb6ca759542b83e3}{lm\+\_\+sidereal}} (const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$timer)
\end{DoxyCompactItemize}


\doxysubsubsection{Macro Definition Documentation}
\mbox{\Hypertarget{time_8h_aa7c3e93bff90674e9e74de6bdec85613}\label{time_8h_aa7c3e93bff90674e9e74de6bdec85613}} 
\index{time.h@{time.h}!NTP\_OFFSET@{NTP\_OFFSET}}
\index{NTP\_OFFSET@{NTP\_OFFSET}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{NTP\_OFFSET}{NTP\_OFFSET}}
{\footnotesize\ttfamily \#define N\+T\+P\+\_\+\+O\+F\+F\+S\+ET~3155673600}

Difference between the Y2K and the N\+TP epochs, in seconds. To convert a Y2K timestamp to N\+TP... 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} ntp;}
\DoxyCodeLine{\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\_t}} y2k;}
\DoxyCodeLine{}
\DoxyCodeLine{y2k = \mbox{\hyperlink{time_8h_a26c7d1dbf93fa8c23c5effbacec91f8c}{time}}(NULL);}
\DoxyCodeLine{ntp = y2k + \mbox{\hyperlink{time_8h_aa7c3e93bff90674e9e74de6bdec85613}{NTP\_OFFSET}};}
\end{DoxyCode}
 \mbox{\Hypertarget{time_8h_a44eb26d33eb6c5e235c6cbfa377f60ae}\label{time_8h_a44eb26d33eb6c5e235c6cbfa377f60ae}} 
\index{time.h@{time.h}!ONE\_DAY@{ONE\_DAY}}
\index{ONE\_DAY@{ONE\_DAY}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{ONE\_DAY}{ONE\_DAY}}
{\footnotesize\ttfamily \#define O\+N\+E\+\_\+\+D\+AY~86400}

One day, expressed in seconds \mbox{\Hypertarget{time_8h_a33af778316d8cac3769692c311825a52}\label{time_8h_a33af778316d8cac3769692c311825a52}} 
\index{time.h@{time.h}!ONE\_DEGREE@{ONE\_DEGREE}}
\index{ONE\_DEGREE@{ONE\_DEGREE}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{ONE\_DEGREE}{ONE\_DEGREE}}
{\footnotesize\ttfamily \#define O\+N\+E\+\_\+\+D\+E\+G\+R\+EE~3600}

Angular degree, expressed in arc seconds \mbox{\Hypertarget{time_8h_ae8dbeb3eda9f88f8f222adea789ec63d}\label{time_8h_ae8dbeb3eda9f88f8f222adea789ec63d}} 
\index{time.h@{time.h}!ONE\_HOUR@{ONE\_HOUR}}
\index{ONE\_HOUR@{ONE\_HOUR}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{ONE\_HOUR}{ONE\_HOUR}}
{\footnotesize\ttfamily \#define O\+N\+E\+\_\+\+H\+O\+UR~3600}

One hour, expressed in seconds \mbox{\Hypertarget{time_8h_a0643a5b723dde6420363401dffc2e67e}\label{time_8h_a0643a5b723dde6420363401dffc2e67e}} 
\index{time.h@{time.h}!UNIX\_OFFSET@{UNIX\_OFFSET}}
\index{UNIX\_OFFSET@{UNIX\_OFFSET}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{UNIX\_OFFSET}{UNIX\_OFFSET}}
{\footnotesize\ttfamily \#define U\+N\+I\+X\+\_\+\+O\+F\+F\+S\+ET~946684800}

Difference between the Y2K and the U\+N\+IX epochs, in seconds. To convert a Y2K timestamp to U\+N\+IX... 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keywordtype}{long} unix;}
\DoxyCodeLine{\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\_t}} y2k;}
\DoxyCodeLine{}
\DoxyCodeLine{y2k = \mbox{\hyperlink{time_8h_a26c7d1dbf93fa8c23c5effbacec91f8c}{time}}(NULL);}
\DoxyCodeLine{unix = y2k + \mbox{\hyperlink{time_8h_a0643a5b723dde6420363401dffc2e67e}{UNIX\_OFFSET}};}
\end{DoxyCode}
 

\doxysubsubsection{Enumeration Type Documentation}
\mbox{\Hypertarget{time_8h_a9ea260b185fe2c5bb23c64f5954c28aa}\label{time_8h_a9ea260b185fe2c5bb23c64f5954c28aa}} 
\index{time.h@{time.h}!\_MONTHS\_@{\_MONTHS\_}}
\index{\_MONTHS\_@{\_MONTHS\_}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{\_MONTHS\_}{\_MONTHS\_}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{time_8h_a9ea260b185fe2c5bb23c64f5954c28aa}{\+\_\+\+M\+O\+N\+T\+H\+S\+\_\+}}}

Enumerated labels for the months. \mbox{\Hypertarget{time_8h_ae6535271b8e2884a9ed9fe92ecfd87e1}\label{time_8h_ae6535271b8e2884a9ed9fe92ecfd87e1}} 
\index{time.h@{time.h}!\_WEEK\_DAYS\_@{\_WEEK\_DAYS\_}}
\index{\_WEEK\_DAYS\_@{\_WEEK\_DAYS\_}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{\_WEEK\_DAYS\_}{\_WEEK\_DAYS\_}}
{\footnotesize\ttfamily enum \mbox{\hyperlink{time_8h_ae6535271b8e2884a9ed9fe92ecfd87e1}{\+\_\+\+W\+E\+E\+K\+\_\+\+D\+A\+Y\+S\+\_\+}}}

Enumerated labels for the days of the week. 

\doxysubsubsection{Function Documentation}
\mbox{\Hypertarget{time_8h_a68a0e9d22417dfcf9c0be64261352e64}\label{time_8h_a68a0e9d22417dfcf9c0be64261352e64}} 
\index{time.h@{time.h}!asctime@{asctime}}
\index{asctime@{asctime}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{asctime()}{asctime()}}
{\footnotesize\ttfamily char$\ast$ asctime (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{timeptr }\end{DoxyParamCaption})}

The asctime function converts the broken-\/down time of timeptr, into an ascii string in the form

Sun Mar 23 01\+:03\+:52 2013 \mbox{\Hypertarget{time_8h_aa1128e048925e3b208213febb8573b88}\label{time_8h_aa1128e048925e3b208213febb8573b88}} 
\index{time.h@{time.h}!asctime\_r@{asctime\_r}}
\index{asctime\_r@{asctime\_r}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{asctime\_r()}{asctime\_r()}}
{\footnotesize\ttfamily void asctime\+\_\+r (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{timeptr,  }\item[{char $\ast$}]{buf }\end{DoxyParamCaption})}

Re entrant version of \mbox{\hyperlink{time_8h_a68a0e9d22417dfcf9c0be64261352e64}{asctime()}}. \mbox{\Hypertarget{time_8h_a72a5383fadfbaa033ac36e9e45b0bd6d}\label{time_8h_a72a5383fadfbaa033ac36e9e45b0bd6d}} 
\index{time.h@{time.h}!ctime@{ctime}}
\index{ctime@{ctime}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{ctime()}{ctime()}}
{\footnotesize\ttfamily char$\ast$ ctime (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

The ctime function is equivalent to asctime(localtime(timer)) \mbox{\Hypertarget{time_8h_a34fa7766f6b0a8a74a41683693eabad9}\label{time_8h_a34fa7766f6b0a8a74a41683693eabad9}} 
\index{time.h@{time.h}!ctime\_r@{ctime\_r}}
\index{ctime\_r@{ctime\_r}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{ctime\_r()}{ctime\_r()}}
{\footnotesize\ttfamily void ctime\+\_\+r (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer,  }\item[{char $\ast$}]{buf }\end{DoxyParamCaption})}

Re entrant version of \mbox{\hyperlink{time_8h_a72a5383fadfbaa033ac36e9e45b0bd6d}{ctime()}}. \mbox{\Hypertarget{time_8h_a71762e360eaab527a334d9114f68aa21}\label{time_8h_a71762e360eaab527a334d9114f68aa21}} 
\index{time.h@{time.h}!daylight\_seconds@{daylight\_seconds}}
\index{daylight\_seconds@{daylight\_seconds}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{daylight\_seconds()}{daylight\_seconds()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}} daylight\+\_\+seconds (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

Computes the amount of time the sun is above the horizon, at the location of the observer.

N\+O\+TE\+: At observer locations inside a polar circle, this value can be zero during the winter, and can exceed O\+N\+E\+\_\+\+D\+AY during the summer.

The returned value is in seconds. \mbox{\Hypertarget{time_8h_a1732c46d47837951d399755899af5240}\label{time_8h_a1732c46d47837951d399755899af5240}} 
\index{time.h@{time.h}!difftime@{difftime}}
\index{difftime@{difftime}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{difftime()}{difftime()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}} difftime (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}}}]{time1,  }\item[{\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}}}]{time0 }\end{DoxyParamCaption})}

The difftime function returns the difference between two binary time stamps, time1 -\/ time0. \mbox{\Hypertarget{time_8h_a633438d79d5dd6f946c8b6ca4ee32111}\label{time_8h_a633438d79d5dd6f946c8b6ca4ee32111}} 
\index{time.h@{time.h}!equation\_of\_time@{equation\_of\_time}}
\index{equation\_of\_time@{equation\_of\_time}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{equation\_of\_time()}{equation\_of\_time()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__stdint_ga932e6ccc3d54c58f761c1aead83bd6d7}{int16\+\_\+t}} equation\+\_\+of\+\_\+time (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

Computes the difference between apparent solar time and mean solar time. The returned value is in seconds. \mbox{\Hypertarget{time_8h_a0e2cda2d867a784b4dfc938ad56bb94f}\label{time_8h_a0e2cda2d867a784b4dfc938ad56bb94f}} 
\index{time.h@{time.h}!fatfs\_time@{fatfs\_time}}
\index{fatfs\_time@{fatfs\_time}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{fatfs\_time()}{fatfs\_time()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__stdint_ga33594304e786b158f3fb30289278f5af}{uint32\+\_\+t}} fatfs\+\_\+time (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{timeptr }\end{DoxyParamCaption})}

Convert a Y2K time stamp into a F\+AT file system time stamp. \mbox{\Hypertarget{time_8h_aae725f7944578bf948bb5c44588b7b7c}\label{time_8h_aae725f7944578bf948bb5c44588b7b7c}} 
\index{time.h@{time.h}!gm\_sidereal@{gm\_sidereal}}
\index{gm\_sidereal@{gm\_sidereal}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{gm\_sidereal()}{gm\_sidereal()}}
{\footnotesize\ttfamily unsigned long gm\+\_\+sidereal (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

Returns Greenwich Mean Sidereal Time, as seconds into the sidereal day. The returned value will range from 0 through 86399 seconds. \mbox{\Hypertarget{time_8h_ae76343d6a51c93b9318ac0ced05225cd}\label{time_8h_ae76343d6a51c93b9318ac0ced05225cd}} 
\index{time.h@{time.h}!gmtime@{gmtime}}
\index{gmtime@{gmtime}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{gmtime()}{gmtime()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structtm}{tm}}$\ast$ gmtime (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

The gmtime function converts the time stamp pointed to by timer into broken-\/down time, expressed as U\+TC. \mbox{\Hypertarget{time_8h_a7cb461118a6aeebeaacd48ee127b952a}\label{time_8h_a7cb461118a6aeebeaacd48ee127b952a}} 
\index{time.h@{time.h}!gmtime\_r@{gmtime\_r}}
\index{gmtime\_r@{gmtime\_r}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{gmtime\_r()}{gmtime\_r()}}
{\footnotesize\ttfamily void gmtime\+\_\+r (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer,  }\item[{struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{timeptr }\end{DoxyParamCaption})}

Re entrant version of \mbox{\hyperlink{time_8h_ae76343d6a51c93b9318ac0ced05225cd}{gmtime()}}. \mbox{\Hypertarget{time_8h_a70762b48818b0b5bfde86973cbdd6c86}\label{time_8h_a70762b48818b0b5bfde86973cbdd6c86}} 
\index{time.h@{time.h}!is\_leap\_year@{is\_leap\_year}}
\index{is\_leap\_year@{is\_leap\_year}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{is\_leap\_year()}{is\_leap\_year()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} is\+\_\+leap\+\_\+year (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__avr__stdint_ga932e6ccc3d54c58f761c1aead83bd6d7}{int16\+\_\+t}}}]{year }\end{DoxyParamCaption})}

Return 1 if year is a leap year, zero if it is not. \mbox{\Hypertarget{time_8h_afe4b12d1be1149c088d61c7cddc945e5}\label{time_8h_afe4b12d1be1149c088d61c7cddc945e5}} 
\index{time.h@{time.h}!iso\_week\_date@{iso\_week\_date}}
\index{iso\_week\_date@{iso\_week\_date}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{iso\_week\_date()}{iso\_week\_date()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structweek__date}{week\+\_\+date}}$\ast$ iso\+\_\+week\+\_\+date (\begin{DoxyParamCaption}\item[{int}]{year,  }\item[{int}]{yday }\end{DoxyParamCaption})}

Return a \mbox{\hyperlink{structweek__date}{week\+\_\+date}} structure with the I\+S\+O\+\_\+8601 week based date corresponding to the given year and day of year. See \href{http://en.wikipedia.org/wiki/ISO_week_date}{\texttt{ http\+://en.\+wikipedia.\+org/wiki/\+I\+S\+O\+\_\+week\+\_\+date}} for more information. \mbox{\Hypertarget{time_8h_a8a4fd6a03c19f96f656316eba80b9c9a}\label{time_8h_a8a4fd6a03c19f96f656316eba80b9c9a}} 
\index{time.h@{time.h}!iso\_week\_date\_r@{iso\_week\_date\_r}}
\index{iso\_week\_date\_r@{iso\_week\_date\_r}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{iso\_week\_date\_r()}{iso\_week\_date\_r()}}
{\footnotesize\ttfamily void iso\+\_\+week\+\_\+date\+\_\+r (\begin{DoxyParamCaption}\item[{int}]{year,  }\item[{int}]{yday,  }\item[{struct \mbox{\hyperlink{structweek__date}{week\+\_\+date}} $\ast$}]{ }\end{DoxyParamCaption})}

Re-\/entrant version of iso-\/week\+\_\+date. \mbox{\Hypertarget{time_8h_a1a85cae701479294885ec9f3c6b2fade}\label{time_8h_a1a85cae701479294885ec9f3c6b2fade}} 
\index{time.h@{time.h}!isotime@{isotime}}
\index{isotime@{isotime}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{isotime()}{isotime()}}
{\footnotesize\ttfamily char$\ast$ isotime (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{tmptr }\end{DoxyParamCaption})}

The isotime function constructs an ascii string in the form 
\begin{DoxyCode}{0}
\DoxyCodeLine{2013-\/03-\/23 01:03:52}
\end{DoxyCode}
 \mbox{\Hypertarget{time_8h_ae200cfc8cc7309d0ce5fef3ee490dc47}\label{time_8h_ae200cfc8cc7309d0ce5fef3ee490dc47}} 
\index{time.h@{time.h}!isotime\_r@{isotime\_r}}
\index{isotime\_r@{isotime\_r}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{isotime\_r()}{isotime\_r()}}
{\footnotesize\ttfamily void isotime\+\_\+r (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{,  }\item[{char $\ast$}]{ }\end{DoxyParamCaption})}

Re entrant version of \mbox{\hyperlink{time_8h_a1a85cae701479294885ec9f3c6b2fade}{isotime()}} \mbox{\Hypertarget{time_8h_a9136313e476a6277cb6ca759542b83e3}\label{time_8h_a9136313e476a6277cb6ca759542b83e3}} 
\index{time.h@{time.h}!lm\_sidereal@{lm\_sidereal}}
\index{lm\_sidereal@{lm\_sidereal}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{lm\_sidereal()}{lm\_sidereal()}}
{\footnotesize\ttfamily unsigned long lm\+\_\+sidereal (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

Returns Local Mean Sidereal Time, as seconds into the sidereal day. The returned value will range from 0 through 86399 seconds. \mbox{\Hypertarget{time_8h_aa9336f97d394e8e02d97b9ff4fb0aca2}\label{time_8h_aa9336f97d394e8e02d97b9ff4fb0aca2}} 
\index{time.h@{time.h}!localtime@{localtime}}
\index{localtime@{localtime}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{localtime()}{localtime()}}
{\footnotesize\ttfamily struct \mbox{\hyperlink{structtm}{tm}}$\ast$ localtime (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

The localtime function converts the time stamp pointed to by timer into broken-\/down time, expressed as Local time. \mbox{\Hypertarget{time_8h_acd9715002deaf28b432a8f2b54dd9aa5}\label{time_8h_acd9715002deaf28b432a8f2b54dd9aa5}} 
\index{time.h@{time.h}!localtime\_r@{localtime\_r}}
\index{localtime\_r@{localtime\_r}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{localtime\_r()}{localtime\_r()}}
{\footnotesize\ttfamily void localtime\+\_\+r (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer,  }\item[{struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{timeptr }\end{DoxyParamCaption})}

Re entrant version of \mbox{\hyperlink{time_8h_aa9336f97d394e8e02d97b9ff4fb0aca2}{localtime()}}. \mbox{\Hypertarget{time_8h_ab687d0e66f0c74b9723ff9c718ea57da}\label{time_8h_ab687d0e66f0c74b9723ff9c718ea57da}} 
\index{time.h@{time.h}!mk\_gmtime@{mk\_gmtime}}
\index{mk\_gmtime@{mk\_gmtime}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{mk\_gmtime()}{mk\_gmtime()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} mk\+\_\+gmtime (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{timeptr }\end{DoxyParamCaption})}

This function \textquotesingle{}compiles\textquotesingle{} the elements of a broken-\/down time structure, returning a binary time stamp. The elements of timeptr are interpreted as representing U\+TC.

The original values of the tm\+\_\+wday and tm\+\_\+yday elements of the structure are ignored, and the original values of the other elements are not restricted to the ranges stated for struct tm.

Unlike \mbox{\hyperlink{time_8h_ae114b9ba0fce4e2d6297e0e66768bb75}{mktime()}}, this function D\+O\+ES N\+OT modify the elements of timeptr. \mbox{\Hypertarget{time_8h_ae114b9ba0fce4e2d6297e0e66768bb75}\label{time_8h_ae114b9ba0fce4e2d6297e0e66768bb75}} 
\index{time.h@{time.h}!mktime@{mktime}}
\index{mktime@{mktime}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{mktime()}{mktime()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} mktime (\begin{DoxyParamCaption}\item[{struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{timeptr }\end{DoxyParamCaption})}

This function \textquotesingle{}compiles\textquotesingle{} the elements of a broken-\/down time structure, returning a binary time stamp. The elements of timeptr are interpreted as representing Local Time.

The original values of the tm\+\_\+wday and tm\+\_\+yday elements of the structure are ignored, and the original values of the other elements are not restricted to the ranges stated for struct tm.

On successful completion, the values of all elements of timeptr are set to the appropriate range. \mbox{\Hypertarget{time_8h_aa743162fd5cbcbaf67371785e812436a}\label{time_8h_aa743162fd5cbcbaf67371785e812436a}} 
\index{time.h@{time.h}!month\_length@{month\_length}}
\index{month\_length@{month\_length}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{month\_length()}{month\_length()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} month\+\_\+length (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__avr__stdint_ga932e6ccc3d54c58f761c1aead83bd6d7}{int16\+\_\+t}}}]{year,  }\item[{\mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}}}]{month }\end{DoxyParamCaption})}

Return the length of month, given the year and month, where month is in the range 1 to 12. \mbox{\Hypertarget{time_8h_a6a79f1da4cd50f398a05679cddc3fede}\label{time_8h_a6a79f1da4cd50f398a05679cddc3fede}} 
\index{time.h@{time.h}!moon\_phase@{moon\_phase}}
\index{moon\_phase@{moon\_phase}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{moon\_phase()}{moon\_phase()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__stdint_gaef44329758059c91c76d334e8fc09700}{int8\+\_\+t}} moon\+\_\+phase (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

Returns an approximation to the phase of the moon. The sign of the returned value indicates a waning or waxing phase. The magnitude of the returned value indicates the percentage illumination. \mbox{\Hypertarget{time_8h_a3b0c7666163850cc95f0f231f388eb2c}\label{time_8h_a3b0c7666163850cc95f0f231f388eb2c}} 
\index{time.h@{time.h}!set\_dst@{set\_dst}}
\index{set\_dst@{set\_dst}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{set\_dst()}{set\_dst()}}
{\footnotesize\ttfamily void set\+\_\+dst (\begin{DoxyParamCaption}\item[{int($\ast$)(const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$, \mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}} $\ast$)}]{ }\end{DoxyParamCaption})}

Specify the Daylight Saving function.

The Daylight Saving function should examine its parameters to determine whether Daylight Saving is in effect, and return a value appropriate for tm\+\_\+isdst.

Working examples for the U\+SA and the EU are available..


\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <util/eu\_dst.h>}}
\end{DoxyCode}
 for the European Union, and 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <util/usa\_dst.h>}}
\end{DoxyCode}
 for the United States

If a Daylight Saving function is not specified, the system will ignore Daylight Saving. \mbox{\Hypertarget{time_8h_a90f87ccc97456fe3dcd867ccf71538ee}\label{time_8h_a90f87ccc97456fe3dcd867ccf71538ee}} 
\index{time.h@{time.h}!set\_position@{set\_position}}
\index{set\_position@{set\_position}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{set\_position()}{set\_position()}}
{\footnotesize\ttfamily void set\+\_\+position (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}}}]{latitude,  }\item[{\mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}}}]{longitude }\end{DoxyParamCaption})}

Set the geographic coordinates of the \textquotesingle{}observer\textquotesingle{}, for use with several of the following functions. Parameters are passed as seconds of North Latitude, and seconds of East Longitude.

For New York City... 
\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{time_8h_a90f87ccc97456fe3dcd867ccf71538ee}{set\_position}}( 40.7142 * \mbox{\hyperlink{time_8h_a33af778316d8cac3769692c311825a52}{ONE\_DEGREE}}, -\/74.0064 * \mbox{\hyperlink{time_8h_a33af778316d8cac3769692c311825a52}{ONE\_DEGREE}}); }
\end{DoxyCode}
 \mbox{\Hypertarget{time_8h_a02663b926feab893c0e0ec1f29b3c315}\label{time_8h_a02663b926feab893c0e0ec1f29b3c315}} 
\index{time.h@{time.h}!set\_system\_time@{set\_system\_time}}
\index{set\_system\_time@{set\_system\_time}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{set\_system\_time()}{set\_system\_time()}}
{\footnotesize\ttfamily void set\+\_\+system\+\_\+time (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}}}]{timestamp }\end{DoxyParamCaption})}

Initialize the system time. Examples are...

From a Clock / Calendar type R\+TC\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{keyword}{struct }\mbox{\hyperlink{structtm}{tm}} rtc\_time;}
\DoxyCodeLine{}
\DoxyCodeLine{read\_rtc(\&rtc\_time);}
\DoxyCodeLine{rtc\_time.tm\_isdst = 0;}
\DoxyCodeLine{\mbox{\hyperlink{time_8h_a02663b926feab893c0e0ec1f29b3c315}{set\_system\_time}}( \mbox{\hyperlink{time_8h_ae114b9ba0fce4e2d6297e0e66768bb75}{mktime}}(\&rtc\_time) );}
\end{DoxyCode}


From a Network Time Protocol time stamp\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{time_8h_a02663b926feab893c0e0ec1f29b3c315}{set\_system\_time}}(ntp\_timestamp -\/ \mbox{\hyperlink{time_8h_aa7c3e93bff90674e9e74de6bdec85613}{NTP\_OFFSET}});}
\end{DoxyCode}


From a U\+N\+IX time stamp\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{time_8h_a02663b926feab893c0e0ec1f29b3c315}{set\_system\_time}}(unix\_timestamp -\/ \mbox{\hyperlink{time_8h_a0643a5b723dde6420363401dffc2e67e}{UNIX\_OFFSET}});}
\end{DoxyCode}
 \mbox{\Hypertarget{time_8h_ab4c127c1405b775b6d25a610d3fc26c3}\label{time_8h_ab4c127c1405b775b6d25a610d3fc26c3}} 
\index{time.h@{time.h}!set\_zone@{set\_zone}}
\index{set\_zone@{set\_zone}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{set\_zone()}{set\_zone()}}
{\footnotesize\ttfamily void set\+\_\+zone (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__avr__stdint_gadb828ef50c2dbb783109824e94cf6c47}{int32\+\_\+t}}}]{ }\end{DoxyParamCaption})}

Set the \textquotesingle{}time zone\textquotesingle{}. The parameter is given in seconds East of the Prime Meridian. Example for New York City\+: 
\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{time_8h_ab4c127c1405b775b6d25a610d3fc26c3}{set\_zone}}(-\/5 * \mbox{\hyperlink{time_8h_ae8dbeb3eda9f88f8f222adea789ec63d}{ONE\_HOUR}});}
\end{DoxyCode}


If the time zone is not set, the time system will operate in U\+TC only. \mbox{\Hypertarget{time_8h_a34ba5295b14e45cef7f99c386fff0230}\label{time_8h_a34ba5295b14e45cef7f99c386fff0230}} 
\index{time.h@{time.h}!solar\_declination@{solar\_declination}}
\index{solar\_declination@{solar\_declination}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{solar\_declination()}{solar\_declination()}}
{\footnotesize\ttfamily double solar\+\_\+declination (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

Returns the declination of the sun in radians. \mbox{\Hypertarget{time_8h_a35cf3a10ed003c844c54b7185fdb5b8a}\label{time_8h_a35cf3a10ed003c844c54b7185fdb5b8a}} 
\index{time.h@{time.h}!solar\_noon@{solar\_noon}}
\index{solar\_noon@{solar\_noon}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{solar\_noon()}{solar\_noon()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} solar\+\_\+noon (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

Computes the time of solar noon, at the location of the observer. \mbox{\Hypertarget{time_8h_aa0344a18cbf5cfc45ffdf43890eac51c}\label{time_8h_aa0344a18cbf5cfc45ffdf43890eac51c}} 
\index{time.h@{time.h}!strftime@{strftime}}
\index{strftime@{strftime}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{strftime()}{strftime()}}
{\footnotesize\ttfamily size\+\_\+t strftime (\begin{DoxyParamCaption}\item[{char $\ast$}]{s,  }\item[{size\+\_\+t}]{maxsize,  }\item[{const char $\ast$}]{format,  }\item[{const struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{timeptr }\end{DoxyParamCaption})}

A complete description of \mbox{\hyperlink{time_8h_aa0344a18cbf5cfc45ffdf43890eac51c}{strftime()}} is beyond the pale of this document. Refer to I\+S\+O/\+I\+EC document 9899 for details.

All conversions are made using the \textquotesingle{}C Locale\textquotesingle{}, ignoring the E or O modifiers. Due to the lack of a time zone \textquotesingle{}name\textquotesingle{}, the \textquotesingle{}Z\textquotesingle{} conversion is also ignored. \mbox{\Hypertarget{time_8h_a21a491a92bce972d041e2194b4577943}\label{time_8h_a21a491a92bce972d041e2194b4577943}} 
\index{time.h@{time.h}!sun\_rise@{sun\_rise}}
\index{sun\_rise@{sun\_rise}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{sun\_rise()}{sun\_rise()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} sun\+\_\+rise (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

Return the time of sunrise, at the location of the observer. See the note about \mbox{\hyperlink{time_8h_a71762e360eaab527a334d9114f68aa21}{daylight\+\_\+seconds()}}. \mbox{\Hypertarget{time_8h_a0865e7b9f075981fafaabd0964de2d7f}\label{time_8h_a0865e7b9f075981fafaabd0964de2d7f}} 
\index{time.h@{time.h}!sun\_set@{sun\_set}}
\index{sun\_set@{sun\_set}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{sun\_set()}{sun\_set()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} sun\+\_\+set (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

Return the time of sunset, at the location of the observer. See the note about \mbox{\hyperlink{time_8h_a71762e360eaab527a334d9114f68aa21}{daylight\+\_\+seconds()}}. \mbox{\Hypertarget{time_8h_a15aea81a8985a4c3cc9c8b00a06f5d31}\label{time_8h_a15aea81a8985a4c3cc9c8b00a06f5d31}} 
\index{time.h@{time.h}!system\_tick@{system\_tick}}
\index{system\_tick@{system\_tick}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{system\_tick()}{system\_tick()}}
{\footnotesize\ttfamily void system\+\_\+tick (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Maintain the system time by calling this function at a rate of 1 Hertz.

It is anticipated that this function will typically be called from within an Interrupt Service Routine, (though that is not required). It therefore includes code which makes it simple to use from within a \textquotesingle{}Naked\textquotesingle{} I\+SR, avoiding the cost of saving and restoring all the cpu registers.

Such an I\+SR may resemble the following example... 
\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{group__avr__interrupts_gad28590624d422cdf30d626e0a506255f}{ISR}}(RTC\_OVF\_vect, \mbox{\hyperlink{group__avr__interrupts_ga8b4c7e44627db0a60d676213add42d64}{ISR\_NAKED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{    \mbox{\hyperlink{time_8h_a15aea81a8985a4c3cc9c8b00a06f5d31}{system\_tick}}();}
\DoxyCodeLine{    \mbox{\hyperlink{group__avr__interrupts_ga3b991e8168db8fc866e31f9a6d10533b}{reti}}();}
\DoxyCodeLine{\}}
\end{DoxyCode}
 \mbox{\Hypertarget{time_8h_a26c7d1dbf93fa8c23c5effbacec91f8c}\label{time_8h_a26c7d1dbf93fa8c23c5effbacec91f8c}} 
\index{time.h@{time.h}!time@{time}}
\index{time@{time}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{time()}{time()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} time (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__avr__time_ga3346b04b0420b32ccf6b706551b70762}{time\+\_\+t}} $\ast$}]{timer }\end{DoxyParamCaption})}

The time function returns the systems current time stamp. If timer is not a null pointer, the return value is also assigned to the object it points to. \mbox{\Hypertarget{time_8h_a53e37af6d547a0afa624fc2230c8db7a}\label{time_8h_a53e37af6d547a0afa624fc2230c8db7a}} 
\index{time.h@{time.h}!week\_of\_month@{week\_of\_month}}
\index{week\_of\_month@{week\_of\_month}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{week\_of\_month()}{week\_of\_month()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} week\+\_\+of\+\_\+month (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{timeptr,  }\item[{\mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}}}]{start }\end{DoxyParamCaption})}

Return the calendar week of month, where the first week is considered to begin on the day of week specified by \textquotesingle{}start\textquotesingle{}. The returned value may range from zero to 5. \mbox{\Hypertarget{time_8h_a6e351ab03dbd6cb078dd48d1f40b9133}\label{time_8h_a6e351ab03dbd6cb078dd48d1f40b9133}} 
\index{time.h@{time.h}!week\_of\_year@{week\_of\_year}}
\index{week\_of\_year@{week\_of\_year}!time.h@{time.h}}
\doxyparagraph{\texorpdfstring{week\_of\_year()}{week\_of\_year()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}} week\+\_\+of\+\_\+year (\begin{DoxyParamCaption}\item[{const struct \mbox{\hyperlink{structtm}{tm}} $\ast$}]{timeptr,  }\item[{\mbox{\hyperlink{group__avr__stdint_gaba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t}}}]{start }\end{DoxyParamCaption})}

Return the calendar week of year, where week 1 is considered to begin on the day of week specified by \textquotesingle{}start\textquotesingle{}. The returned value may range from zero to 52. 