[Haskell-cafe] Converting string to System.Time.ClockTime

Antoine Latter aslatter at gmail.com
Thu Dec 8 16:17:37 CET 2011


On Thu, Dec 8, 2011 at 9:13 AM, Antoine Latter <aslatter at gmail.com> wrote:
> On Thu, Dec 8, 2011 at 9:01 AM, dokondr <dokondr at gmail.com> wrote:
>> Now, when I have managed to convert UTCTime to seconds (see code below) I
>> got stuck trying to convert from UTCTime to CalendarTime, how to do this?
>>
>>
>
> It might be easier to use 'diffUTCTime' and 'addUTCTime' instead of
> converting to and from POSIX seconds.
>

For those reading along at home, 'addUTCTime' and 'diffUTCTime' are
implemented in terms of 'posixSecondsToUTCTime' and
'utcTimeToPOSIXSeconds'. So it's pretty similar in the end.

Antoine



More information about the Haskell-Cafe mailing list