Get Unix / Epoch time as Int

后端 未结 6 1448
日久生厌
日久生厌 2020-12-30 23:44

Is there a function in haskell for epoch time in seconds / milliseconds ?

perhaps something similar to java\'s

System.currentTimeMillis();
         


        
6条回答
  •  时光说笑
    2020-12-31 00:32

    There is also the solution discussed in Real World Haskell:

    import System.Time
    getClockTime >>= (\(TOD sec _) -> return sec)
    

提交回复
热议问题