Questions tagged [haskell-time]

https://hackage.haskell.org/package/time

4 questions
12
votes
2 answers

How do I convert DiffTime to NominalDiffTime?

Using the time library (time-1.5), I have a constant, e.g. 1 second. I don't see a way to create a NominalDiffTime, so I have created a DiffTime: twoSeconds = secondsToDiffTime 2 Now I'd like to interact with a UTCTime: now <- getCurrentTime let…
Daniel K
  • 887
  • 6
  • 13
3
votes
2 answers

How do I create a UTCTime value using the time library in Haskell?

I've got a year, month, day, hour and minute value (all of them are of type Int) - how can I convert these to a UTCTime? Just as How do I create a UTCTime from Int values, using the thyme library in Haskell? but using the time library instead.
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
1
vote
1 answer

How do I get the amount of seconds from NominalDiffTime in the time library < v1.9.1?

It seems there is a function for this in time v1.9.1 (http://hackage.haskell.org/package/time-1.9.2/docs/Data-Time-Clock.html#v:nominalDiffTimeToSeconds) but my stack configuration is not compatible with this version. I've tried stack solver with…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
1
vote
1 answer

Using Haskell Time library ISO8601 format

I'm using the Haskell Time Library. I'm trying to use the ISO-8601 date formatters. In my code, I can import the Data.Time module and use it without any problems. However, when I import the Data.Time.Format.ISO8601 functions and definitions I get…
MMacphail
  • 541
  • 3
  • 19