Files
dotfiles/cabal/share/doc/x86_64-osx-ghc-7.10.1/MissingH-1.3.0.1/html/System-Time-Utils.html
2015-04-05 17:47:08 +02:00

20 lines
9.5 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>System.Time.Utils</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_System-Time-Utils.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">MissingH-1.3.0.1: Large utility library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Copyright</th><td>Copyright (C) 2004-2011 John Goerzen</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>John Goerzen &lt;jgoerzen@complete.org&gt; </td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>portable</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">System.Time.Utils</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module provides various Haskell utilities for dealing with times and
dates.</p><p>Written by John Goerzen, jgoerzen@complete.org</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:timelocal">timelocal</a> :: <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:CalendarTime">CalendarTime</a> -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Integer">Integer</a></li><li class="src short"><a href="#v:timegm">timegm</a> :: <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:CalendarTime">CalendarTime</a> -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Integer">Integer</a></li><li class="src short"><a href="#v:timeDiffToSecs">timeDiffToSecs</a> :: <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:TimeDiff">TimeDiff</a> -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Integer">Integer</a></li><li class="src short"><a href="#v:epoch">epoch</a> :: <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:CalendarTime">CalendarTime</a></li><li class="src short"><a href="#v:epochToClockTime">epochToClockTime</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Real">Real</a> a =&gt; a -&gt; <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:ClockTime">ClockTime</a></li><li class="src short"><a href="#v:clockTimeToEpoch">clockTimeToEpoch</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Num">Num</a> a =&gt; <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:ClockTime">ClockTime</a> -&gt; a</li><li class="src short"><a href="#v:renderSecs">renderSecs</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Integer">Integer</a> -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:renderTD">renderTD</a> :: <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:TimeDiff">TimeDiff</a> -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:timelocal" class="def">timelocal</a> :: <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:CalendarTime">CalendarTime</a> -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Integer">Integer</a></p><div class="doc"><p>Converts the specified CalendarTime (see System.Time) to
seconds-since-epoch format.</p><p>The input CalendarTime is assumed to be the time as given in your local
timezone. All timezone and DST fields in the object are ignored.</p><p>This behavior is equivolent to the timelocal() and mktime() functions that
C programmers are accustomed to.</p><p>Please note that the behavior for this function during the hour immediately
before or after a DST switchover may produce a result with a different hour
than you expect.</p></div></div><div class="top"><p class="src"><a name="v:timegm" class="def">timegm</a> :: <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:CalendarTime">CalendarTime</a> -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Integer">Integer</a></p><div class="doc"><p>Converts the specified CalendarTime (see System.Time) to seconds-since-epoch time.</p><p>This conversion does respect the timezone specified on the input object.
If you want a conversion from UTC, specify ctTZ = 0 and ctIsDST = False.</p><p>When called like that, the behavior is equivolent to the GNU C function
timegm(). Unlike the C library, Haskell's CalendarTime supports
timezone information, so if such information is specified, it will impact
the result.</p></div></div><div class="top"><p class="src"><a name="v:timeDiffToSecs" class="def">timeDiffToSecs</a> :: <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:TimeDiff">TimeDiff</a> -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Integer">Integer</a></p><div class="doc"><p>Converts the given timeDiff to the number of seconds it represents. </p><p>Uses the same algorithm as normalizeTimeDiff in GHC. </p></div></div><div class="top"><p class="src"><a name="v:epoch" class="def">epoch</a> :: <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:CalendarTime">CalendarTime</a></p><div class="doc"><p>January 1, 1970, midnight, UTC, represented as a CalendarTime. </p></div></div><div class="top"><p class="src"><a name="v:epochToClockTime" class="def">epochToClockTime</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Real">Real</a> a =&gt; a -&gt; <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:ClockTime">ClockTime</a></p><div class="doc"><p>Converts an Epoch time represented with an arbitrary Real to a ClockTime.
This input could be a CTime from Foreign.C.Types or an EpochTime from
System.Posix.Types. </p></div></div><div class="top"><p class="src"><a name="v:clockTimeToEpoch" class="def">clockTimeToEpoch</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Num">Num</a> a =&gt; <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:ClockTime">ClockTime</a> -&gt; a</p><div class="doc"><p>Converts a ClockTime to something represented with an arbitrary Real.
The result could be treated as a CTime from Foreign.C.Types or EpochTime from
System.Posix.Types. The inverse of <code><a href="System-Time-Utils.html#v:epochToClockTime">epochToClockTime</a></code>.</p><p>Fractions of a second are not preserved by this function. </p></div></div><div class="top"><p class="src"><a name="v:renderSecs" class="def">renderSecs</a> :: <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Prelude.html#t:Integer">Integer</a> -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a></p><div class="doc"><p>Render a number of seconds as a human-readable amount. Shows the two
most significant places. For instance:</p><pre>renderSecs 121 = &quot;2m1s&quot;</pre><p>See also <code><a href="System-Time-Utils.html#v:renderTD">renderTD</a></code> for a function that works on a TimeDiff.</p></div></div><div class="top"><p class="src"><a name="v:renderTD" class="def">renderTD</a> :: <a href="file:///Users/sidharta/.cabal/share/doc/x86_64-osx-ghc-7.10.1/old-time-1.1.0.3/html/System-Time.html#t:TimeDiff">TimeDiff</a> -&gt; <a href="file:///usr/local/Cellar/ghc/7.10.1/share/doc/ghc/html/libraries/base-4.8.0.0/Data-String.html#t:String">String</a></p><div class="doc"><p>Like <code><a href="System-Time-Utils.html#v:renderSecs">renderSecs</a></code>, but takes a TimeDiff instead of an integer second
count. </p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.0</p></div></body></html>