September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -1,13 +1,11 @@
import Control.Monad
import Data.Time
import System.Locale
(FormatTime, formatTime, defaultTimeLocale, utcToLocalTime,
getCurrentTimeZone, getCurrentTime)
format1 :: FormatTime t => t -> String
format1 = formatTime defaultTimeLocale "%Y-%m-%e"
format2 :: FormatTime t => t -> String
format2 = formatTime defaultTimeLocale "%A, %B %d, %Y"
formats :: FormatTime t => [t -> String]
formats = (formatTime defaultTimeLocale) <$> ["%F", "%A, %B %d, %Y"]
main :: IO ()
main = do
t <- liftM2 utcToLocalTime getCurrentTimeZone getCurrentTime
mapM_ putStrLn [format1 t, format2 t]
t <- pure utcToLocalTime <*> getCurrentTimeZone <*> getCurrentTime
putStrLn $ unlines (formats <*> pure t)