1 module Data.Gargantext.Utils.DateUtils where
3 import Data.Time (UTCTime, toGregorian, utctDay)
6 --readInt :: IO [Char] -> IO Int
9 --readBool :: IO [Char] -> IO Bool
12 utc2gregorian :: UTCTime -> (Integer, Int, Int)
13 utc2gregorian date = toGregorian $ utctDay date
15 gregorian2year :: (Integer, Int, Int) -> Integer
16 gregorian2year (y, _m, _d) = y
18 utc2year :: UTCTime -> Integer
19 utc2year date = gregorian2year $ utc2gregorian date
21 averageLength :: Fractional a => [[a1]] -> a
22 averageLength l = fromIntegral (sum (map length l)) / fromIntegral (length l)
26 -- c <- getCurrentTime
27 -- print c -- $ toYear $ toGregorian $ utctDay c
29 charToString :: Char -> String