Hello.<br><br>This is a part of a solution, with explicit TimeZone<br><br>Prelude Data.Time&gt; :t \z s t -&gt; utcToLocalTime z $ addUTCTime (fromIntegral s) (localTimeToUTC z t)<br>\z s t -&gt; utcToLocalTime z $ addUTCTime (fromIntegral s) (localTimeToUTC z t)<br>
  :: Integral a =&gt; TimeZone -&gt; a -&gt; LocalTime -&gt; LocalTime<br><br>where the Integral arguments is in seconds, by docs<br><br>regards<br>paolino<br><br><br><br><div class="gmail_quote">2012/8/18 Adde Nilsson <span dir="ltr">&lt;<a href="mailto:trialcodr@gmail.com" target="_blank">trialcodr@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi.</div><div>How do you add to or subtract from a LocalTime? </div><div>I&#39;m trying to subtract a second from a LocalTime value but the only API&#39;s I can find act only on the TimeOfDay part.</div>
<div><br></div>
<div>subSec :: LocalTime -&gt; LocalTime</div><div>subSec (LocalTime d t) = LocalTime d $ timeToTimeOfDay ((timeOfDayToTime t) - (secondsToDiffTime 1))</div><div><br></div><div>I&#39;m obviously on the wrong track as this looks way too complex for what it&#39;s trying to achieve.</div>

<div>Calling with &#39;2012-08-18 00:00:00&#39; gives &#39;2012-08-18 -01:59:59&#39; which isn&#39;t very helpful. How do I get to &#39;2012-08-17 23:59:59&#39;?</div><div><br></div><div>Thanks,</div><div>Adde</div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>