Revision ace37e24 src/Ganeti/Utils.hs
b/src/Ganeti/Utils.hs | ||
---|---|---|
45 | 45 |
, exitUnless |
46 | 46 |
, rStripSpace |
47 | 47 |
, newUUID |
48 |
, getCurrentTime |
|
48 | 49 |
, clockTimeToString |
49 | 50 |
, chompPrefix |
50 | 51 |
) where |
... | ... | |
290 | 291 |
contents <- readFile C.randomUuidFile |
291 | 292 |
return $! rStripSpace $ take 128 contents |
292 | 293 |
|
294 |
-- | Returns the current time as an Integer representing the number of |
|
295 |
-- seconds from the Unix epoch. |
|
296 |
getCurrentTime :: IO Integer |
|
297 |
getCurrentTime = do |
|
298 |
TOD ctime _ <- getClockTime |
|
299 |
return ctime |
|
300 |
|
|
293 | 301 |
-- | Convert a ClockTime into a (seconds-only) timestamp. |
294 | 302 |
clockTimeToString :: ClockTime -> String |
295 | 303 |
clockTimeToString (TOD t _) = show t |
Also available in: Unified diff