1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
9<title>OSTicksToCalendarTime</title>
10</head>
11
12<body>
13
14<h1>OSTicksToCalendarTime</h1>
15
16
17<h2>C Specification</h2>
18
19<dl>
20<dd><pre><code>#include &lt;revolution/os.h&gt;
21
22typedef struct OSCalendarTime
23{
24int sec;    // seconds after the minute [0, 61]
25int min;    // minutes after the hour [0, 59]
26int hour;   // hours since midnight [0, 23]
27int mday;   // day of the month [1, 31]
28int mon;    // month since January [0, 11]
29int year;   // year [1, ...]
30int wday;   // days since Sunday [0, 6]
31int yday;   // days since January 1 [0, 365]
32
33int msec;   // milliseconds after the second [0,999]
34int usec;   // microseconds after the millisecond [0,999]
35} OSCalendarTime;</code></pre>
36  </dd>
37<dd><pre><CODE>void OSTicksToCalendarTime (OSTime ticks, OSCalendarTime* td);</CODE></pre>
38  </dd>
39</dl>
40
41<h2>Arguments</h2>
42<TABLE border="1" cellpadding="3" cellspacing="0.1">
43  <tr>
44<TD width="120" bgcolor="#ffffe8"><code><strong><em><STRONG><EM><CODE>ticks</CODE></EM></STRONG></em></strong></code></TD>
45<TD width="520">64-bit <code>OSTime</code>  type integer value.</TD>
46    </tr>
47  <tr>
48<TD width="120" bgcolor="#ffffe8"><code><strong><em><STRONG><EM><CODE>td</CODE></EM></STRONG></em></strong></code></TD>
49<TD width="520">Pointer to the <code>OSCalendarTime</code> type that gets calendar time.</TD>
50    </tr>
51</TABLE>
52<h2>Return Values</h2>
53
54<P>None.</P>
55<H2>Description</H2>
56<P>Converts time from units of ticks (at <code>OS_TIMER_CLOCK</code> Hz) to calendar time.</P>
57
58<P>To get the current date and time, call the <code>OSTicksToCalendarTime</code> function as shown below:</P>
59
60<blockquote>
61<pre>OSCalendarTime td;
62
63OSTicksToCalendarTime(<a href="OSGetTime.html">OSGetTime()</a>, &amp;td);</pre>
64</blockquote>
65
66
67<h2>See Also</h2>
68
69<p><a href="../toc.html#Time" target="contents">Time functions</a>, <code><a href="OSTicksToCycles.html">OSTicksToCycles</a></code>, <code><a href="OSTicksToSeconds.html">OSTicksToSeconds</a></code>, <code><a href="OSTicksToMilliseconds.html">OSTicksToMilliseconds</a></code>, <code><a href="OSSecondsToTicks.html">OSSecondsToTicks</a></code>, <code><a href="OSMillisecondsToTicks.html">OSMillisecondsToTicks</a></code>, <code><a href="OSMicrosecondsToTicks.html">OSMicrosecondsToTicks</a></code>, <a href="OSNanosecondsToTicks.html"><code>OSNanosecondsToTicks</code></a>, <code><a href="OSCalendarTimeToTicks.html">OSCalendarTimeToTicks</a></code></p>
70<H2>Revision History</H2>
71<P>03/01/2006 Initial version.</P>
72</body>
73</html>