RosettaCodeData/Task/System-time/Haskell/system-time-1.hs

12 lines
308 B
Haskell
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
import System.Time
2017-09-23 10:01:46 +02:00
(getClockTime, toCalendarTime, formatCalendarTime)
2013-04-11 01:07:29 -07:00
2017-09-23 10:01:46 +02:00
import System.Locale (defaultTimeLocale)
main :: IO ()
main = do
ct <- getClockTime
print ct -- print default format, or
cal <- toCalendarTime ct
putStrLn $ formatCalendarTime defaultTimeLocale "%a %b %e %H:%M:%S %Y" cal