282 lines
12 KiB
HTML
282 lines
12 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<title>time_of_day module — pylib 2019.5.19 documentation</title>
|
||
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||
<script type="text/javascript" src="_static/language_data.js"></script>
|
||
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
|
||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||
|
||
</head><body>
|
||
|
||
|
||
<div class="document">
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
|
||
|
||
<div class="body" role="main">
|
||
|
||
<div class="section" id="module-time_of_day">
|
||
<span id="time-of-day-module"></span><h1>time_of_day module<a class="headerlink" href="#module-time_of_day" title="Permalink to this headline">¶</a></h1>
|
||
<p>Calculate time.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Date</dt>
|
||
<dd class="field-odd"><p>2019-06-01</p>
|
||
</dd>
|
||
</dl>
|
||
<span class="target" id="module-time_of_day"></span><dl class="function">
|
||
<dt id="time_of_day.days">
|
||
<code class="sig-name descname">days</code><span class="sig-paren">(</span><em class="sig-param">time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/time_of_day.html#days"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#time_of_day.days" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The days of the time (year).</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>time</strong> (float or <cite>time.struct_time</cite>) – the time in seconds</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>hours, range [0, 365.2425]</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>float</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="time_of_day.days_norm">
|
||
<code class="sig-name descname">days_norm</code><span class="sig-paren">(</span><em class="sig-param">time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/time_of_day.html#days_norm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#time_of_day.days_norm" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The days normalized to 365.2425 (Gregorian, on average) days.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>time</strong> (float or <cite>time.struct_time</cite>) – the time in seconds</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>the normalized days, range [0, 1]</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>float</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="time_of_day.hours">
|
||
<code class="sig-name descname">hours</code><span class="sig-paren">(</span><em class="sig-param">time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/time_of_day.html#hours"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#time_of_day.hours" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The hours of the time.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>time</strong> (float or <cite>time.struct_time</cite>) – the time in seconds</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>hours, range [0, 24]</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>float</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="time_of_day.hours_norm">
|
||
<code class="sig-name descname">hours_norm</code><span class="sig-paren">(</span><em class="sig-param">time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/time_of_day.html#hours_norm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#time_of_day.hours_norm" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The hours normalized to 24 hours.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>time</strong> (float or <cite>time.struct_time</cite>) – the time in seconds</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>the normalized hours, range [0, 1]</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>float</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="time_of_day.in_seconds">
|
||
<code class="sig-name descname">in_seconds</code><span class="sig-paren">(</span><em class="sig-param">time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/time_of_day.html#in_seconds"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#time_of_day.in_seconds" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>If time is <cite>time.struct_time</cite> convert to float seconds.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>time</strong> (float or <cite>time.struct_time</cite>) – the time in seconds</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>the time in seconds</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>float</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="time_of_day.minutes">
|
||
<code class="sig-name descname">minutes</code><span class="sig-paren">(</span><em class="sig-param">time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/time_of_day.html#minutes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#time_of_day.minutes" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The minutes of the time.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>time</strong> (float or <cite>time.struct_time</cite>) – the time in seconds</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>minutes, range [0, 60]</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>float</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="time_of_day.minutes_norm">
|
||
<code class="sig-name descname">minutes_norm</code><span class="sig-paren">(</span><em class="sig-param">time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/time_of_day.html#minutes_norm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#time_of_day.minutes_norm" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The minutes normalized to 60 minutes.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>time</strong> (float or <cite>time.struct_time</cite>) – the time in seconds</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>the normalized minutes, range [0, 1]</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>float</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="time_of_day.seconds">
|
||
<code class="sig-name descname">seconds</code><span class="sig-paren">(</span><em class="sig-param">time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/time_of_day.html#seconds"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#time_of_day.seconds" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The seconds of the time.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>time</strong> (float or <cite>time.struct_time</cite>) – the time in seconds</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>seconds, range [0, 60]</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>float</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="time_of_day.seconds_norm">
|
||
<code class="sig-name descname">seconds_norm</code><span class="sig-paren">(</span><em class="sig-param">time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/time_of_day.html#seconds_norm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#time_of_day.seconds_norm" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>The seconds normalized to 60 seconds.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>time</strong> (float or <cite>time.struct_time</cite>) – the time in seconds</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>the normalized seconds, range [0, 1]</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>float</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="time_of_day.transform">
|
||
<code class="sig-name descname">transform</code><span class="sig-paren">(</span><em class="sig-param">time_norm</em>, <em class="sig-param">length</em>, <em class="sig-param">offset=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/time_of_day.html#transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#time_of_day.transform" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Transform normalized time value to new length.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>position_norm</strong> (<em>float</em>) – the normalized time value to transform</p></li>
|
||
<li><p><strong>length</strong> (<em>float</em>) – the transformation</p></li>
|
||
<li><p><strong>offset</strong> (<em>float</em>) – the offset (default = 0)</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>the transformation value</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>float</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<h1 class="logo"><a href="index.html">pylib</a></h1>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<h3>Navigation</h3>
|
||
|
||
<div class="relations">
|
||
<h3>Related Topics</h3>
|
||
<ul>
|
||
<li><a href="index.html">Documentation overview</a><ul>
|
||
</ul></li>
|
||
</ul>
|
||
</div>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3 id="searchlabel">Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="search.html" method="get">
|
||
<input type="text" name="q" aria-labelledby="searchlabel" />
|
||
<input type="submit" value="Go" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script type="text/javascript">$('#searchbox').show(0);</script>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="footer">
|
||
©2019, Daniel Weschke.
|
||
|
||
|
|
||
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.1.2</a>
|
||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||
|
||
|
|
||
<a href="_sources/time_of_day.rst.txt"
|
||
rel="nofollow">Page source</a>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</body>
|
||
</html> |