<html> <head> <title>/vobs/ttcn/TCC_Common/Libraries/TCCUsefulFunctions_CNL113472/src/TCCDateTime.cc - TCCUsefulFunctions</title> <link rel="stylesheet" type="text/css" href="../styles/main.css"> <script language=JavaScript src="../javascript/main.js"></script></head> <body class="FramedContentPage" onLoad="NDOnLoad()"> <script language=JavaScript> <!-- if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script> <!-- Generated by Natural Docs, version 1.4 --> <!-- http://www.naturaldocs.org --> <!-- saved from url=(0026)http://www.naturaldocs.org --> <div id=Content> <div class="CFile"> <div class=CTopic id=MainTopic> <h1 class=CTitle> <a name="TCCDateTime.cc"></a>TCCDateTime.cc</h1> <div class=CBody> <!--START_ND_SUMMARY--> <div class=Summary> <div class=STitle>Summary</div> <div class=SBorder> <table border=0 cellspacing=0 cellpadding=0 class=STable> <tr class="SMain"> <td class=SEntry> <a href="#TCCDateTime.cc" >TCCDateTime.cc</a></td> <td class=SDescription></td></tr> <tr class="SGroup"> <td class=SEntry> <a href="#Functions" >Functions</a></td> <td class=SDescription></td></tr> <tr class="SFunction SIndent1 SMarked"> <td class=SEntry> <a href="#f__time" >f__time</a></td> <td class=SDescription>Current calendar time of the system in seconds</td></tr> <tr class="SFunction SIndent1"> <td class=SEntry> <a href="#f__ctime" >f__ctime</a></td> <td class=SDescription>Convert a time value in seconds to human readable string. </td></tr> <tr class="SFunction SIndent1 SMarked"> <td class=SEntry> <a href="#f__ctime__UTC" >f__ctime__UTC</a></td> <td class=SDescription>Convert a time value in seconds to human readable string. </td></tr> <tr class="SFunction SIndent1"> <td class=SEntry> <a href="#f__getTimeFormatted" >f__getTimeFormatted</a></td> <td class=SDescription>Return the current calendar time in a formatted way</td></tr> <tr class="SFunction SIndent1 SMarked"> <td class=SEntry> <a href="#f__time2sec" >f__time2sec</a></td> <td class=SDescription>Function to convert a formated time value to seconds. </td></tr> <tr class="SFunction SIndent1"> <td class=SEntry> <a href="#f__time2sec__UTC" >f__time2sec__UTC</a></td> <td class=SDescription>Function to convert a formated time value to seconds. </td></tr> <tr class="SFunction SIndent1 SMarked"> <td class=SEntry> <a href="#f__getCurrentDateWithOffset" >f__getCurrentDateWithOffset</a></td> <td class=SDescription>Generate a date from the actual date and time plus the parameter in seconds e.g. </td></tr> <tr class="SFunction SIndent1"> <td class=SEntry> <a href="#f__getCurrentGMTDate" >f__getCurrentGMTDate</a></td> <td class=SDescription>Return the current GMT date in format RFC 1123-Date e.g.:Sat, 13 Nov 2010 23:30:02 GMT</td></tr> <tr class="SFunction SIndent1 SMarked"> <td class=SEntry> <a href="#f__tic" >f__tic</a></td> <td class=SDescription>Return the number of clock ticks used by the application since the program was launched</td></tr> <tr class="SFunction SIndent1"> <td class=SEntry> <a href="#f__toc" >f__toc</a></td> <td class=SDescription>Elapsed seconds since time t (only when f__tic() returns the number of clock ticks elapsed since the program was launched)</td></tr> <tr class="SFunction SIndent1 SMarked"> <td class=SEntry> <a href="#f__timeDiff" >f__timeDiff</a></td> <td class=SDescription>Difference between two time</td></tr></table></div></div> <!--END_ND_SUMMARY--></div></div></div> <div class="CGroup"> <div class=CTopic> <h3 class=CTitle> <a name="Functions"></a>Functions</h3></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__time"></a>f__time</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Current calendar time of the system in seconds</p> <h4 class=CHeading>Parameters</h4> <p>-</p> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>integer</td> <td class=CDLDescription>time value</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p>-</p></div></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__ctime"></a>f__ctime</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Convert a time value in seconds to human readable string. The time represented as local time</p> <h4 class=CHeading>Parameters</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>pl__sec</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - time value</td></tr></table> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>integer</td> <td class=CDLDescription>converted time value</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p>-</p></div></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__ctime__UTC"></a>f__ctime__UTC</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Convert a time value in seconds to human readable string. The time represented as UTC</p> <h4 class=CHeading>Parameters</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>pl__sec</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - time value</td></tr></table> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>integer</td> <td class=CDLDescription>converted time value</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p>-</p></div></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__getTimeFormatted"></a>f__getTimeFormatted</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Return the current calendar time in a formatted way</p> <h4 class=CHeading>Parameters</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>pl__sec</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - time value</td></tr> <tr> <td class=CDLEntry>pl__format</td> <td class=CDLDescription> <b>in</b> <b>charstring</b> - format string</td></tr></table> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>charstring</td> <td class=CDLDescription>formatted time in string format</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p> <b>Specifier / Replaced by / Example</b></p> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>%a</td> <td class=CDLDescription>Abbreviated weekday name * - Thu</td></tr> <tr> <td class=CDLEntry>%A</td> <td class=CDLDescription>Full weekday name * - Thursday</td></tr> <tr> <td class=CDLEntry>%b</td> <td class=CDLDescription>Abbreviated month name * - Aug</td></tr> <tr> <td class=CDLEntry>%B</td> <td class=CDLDescription>Full month name * - August</td></tr> <tr> <td class=CDLEntry>%c</td> <td class=CDLDescription>Date and time representation * - Thu Aug 23 14:55:02 2001</td></tr> <tr> <td class=CDLEntry>%d</td> <td class=CDLDescription>Day of the month (01-31) - 23</td></tr> <tr> <td class=CDLEntry>%H</td> <td class=CDLDescription>Hour in 24h format (00-23) - 14</td></tr> <tr> <td class=CDLEntry>%I</td> <td class=CDLDescription>Hour in 12h format (01-12) - 02</td></tr> <tr> <td class=CDLEntry>%j</td> <td class=CDLDescription>Day of the year (001-366) - 235</td></tr> <tr> <td class=CDLEntry>%m</td> <td class=CDLDescription>Month as a decimal number (01-12) - 08</td></tr> <tr> <td class=CDLEntry>%M</td> <td class=CDLDescription>Minute (00-59) - 55</td></tr> <tr> <td class=CDLEntry>%p</td> <td class=CDLDescription>AM or PM designation - PM</td></tr> <tr> <td class=CDLEntry>%S</td> <td class=CDLDescription>Second (00-61) - 02</td></tr> <tr> <td class=CDLEntry>%U</td> <td class=CDLDescription>Week number with the first Sunday as the first day of week one (00-53) - 33</td></tr> <tr> <td class=CDLEntry>%w</td> <td class=CDLDescription>Weekday as a decimal number with Sunday as 0 (0-6) - 4</td></tr> <tr> <td class=CDLEntry>%W</td> <td class=CDLDescription>Week number with the first Monday as the first day of week one (00-53) - 34</td></tr> <tr> <td class=CDLEntry>%x</td> <td class=CDLDescription>Date representation * - 08/23/01</td></tr> <tr> <td class=CDLEntry>%X</td> <td class=CDLDescription>Time representation * - 14:55:02</td></tr> <tr> <td class=CDLEntry>%y</td> <td class=CDLDescription>Year, last two digits (00-99) - 01</td></tr> <tr> <td class=CDLEntry>%Y</td> <td class=CDLDescription>Year - 2001</td></tr> <tr> <td class=CDLEntry>%Z</td> <td class=CDLDescription>Timezone name or abbreviation - CDT</td></tr> <tr> <td class=CDLEntry>%%</td> <td class=CDLDescription>A % sign - %</td></tr></table> <ul> <li>The specifiers whose description is marked with an asterisk (*) are locale-dependent.</li></ul></div></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__time2sec"></a>f__time2sec</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Function to convert a formated time value to seconds. The time is expressed as local time.</p> <h4 class=CHeading>Parameters</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>pl__year</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - year (e.g. 2007)</td></tr> <tr> <td class=CDLEntry>pl__mon</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - month (e.g. 3)</td></tr> <tr> <td class=CDLEntry>pl__day</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - day (e.g. 7)</td></tr> <tr> <td class=CDLEntry>pl__hour</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - day (e.g. 12)</td></tr> <tr> <td class=CDLEntry>pl__min</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - day (e.g. 50)</td></tr> <tr> <td class=CDLEntry>pl__sec</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - day (e.g. 7)</td></tr></table> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>integer</td> <td class=CDLDescription>time in seconds</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p>time in seconds since January 1, 1900</p></div></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__time2sec__UTC"></a>f__time2sec__UTC</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Function to convert a formated time value to seconds. The time is expressed as UTC.</p> <h4 class=CHeading>Parameters</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>pl__year</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - year (e.g. 2007)</td></tr> <tr> <td class=CDLEntry>pl__mon</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - month (e.g. 3)</td></tr> <tr> <td class=CDLEntry>pl__day</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - day (e.g. 7)</td></tr> <tr> <td class=CDLEntry>pl__hour</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - day (e.g. 12)</td></tr> <tr> <td class=CDLEntry>pl__min</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - day (e.g. 50)</td></tr> <tr> <td class=CDLEntry>pl__sec</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - day (e.g. 7)</td></tr></table> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>integer</td> <td class=CDLDescription>time in seconds</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p>time in seconds since January 1, 1900</p></div></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__getCurrentDateWithOffset"></a>f__getCurrentDateWithOffset</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Generate a date from the actual date and time plus the parameter in seconds e.g. getSdate(30) will return a charstring containing the date and time of 30 seconds later</p> <h4 class=CHeading>Parameters</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>pl__sec</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - offset time value</td></tr></table> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>charstring</td> <td class=CDLDescription>formatted time in string format</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p>-</p></div></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__getCurrentGMTDate"></a>f__getCurrentGMTDate</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Return the current GMT date in format RFC 1123-Date e.g.:Sat, 13 Nov 2010 23:30:02 GMT</p> <h4 class=CHeading>Parameters</h4> <p>-</p> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>charstring</td> <td class=CDLDescription>formatted time in string format</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p>-</p></div></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__tic"></a>f__tic</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Return the number of clock ticks used by the application since the program was launched</p> <p>OR</p> <p>Return the amount of CPU time in microseconds since the last call of f__tic</p> <p>OR ...</p> <p>Warning! This function depends on used library version. Be careful!</p> <h4 class=CHeading>Parameters</h4> <p>-</p> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>integer</td> <td class=CDLDescription>tics since program start</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p>-</p></div></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__toc"></a>f__toc</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Elapsed seconds since time t (only when f__tic() returns the number of clock ticks elapsed since the program was launched)</p> <p>Warning! This function depends on used library version. Be careful!</p> <h4 class=CHeading>Parameters</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>t</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - time value</td></tr></table> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>float</td> <td class=CDLDescription>elapsed seconds</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p>f__tic counts clock tics since program start. f__toc counts seconds since clock() readout in t till current time</p></div></div></div> <div class="CFunction"> <div class=CTopic> <h3 class=CTitle> <a name="f__timeDiff"></a>f__timeDiff</h3> <div class=CBody> <h4 class=CHeading>Purpose</h4> <p>Difference between two time</p> <h4 class=CHeading>Parameters</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>t_start</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - start time</td></tr> <tr> <td class=CDLEntry>t_stop</td> <td class=CDLDescription> <b>in</b> <b>integer</b> - stop time</td></tr></table> <h4 class=CHeading>Return Value</h4> <table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList> <tr> <td class=CDLEntry>integer</td> <td class=CDLDescription>t_stop-t_start</td></tr></table> <h4 class=CHeading>Errors</h4> <p>-</p> <h4 class=CHeading>Detailed description</h4> <p>-</p></div></div></div> </div> <!--Content--> <!--START_ND_TOOLTIPS--> <!--END_ND_TOOLTIPS--> <script language=JavaScript> <!-- if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>