Created
December 8, 2017 15:30
-
-
Save PsyDebug/fc682bebf0b308781ff083b057973222 to your computer and use it in GitHub Desktop.
Get suid as date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Web.Scotty (scotty, get, ScottyM, ActionM, text) | |
import Data.Time | |
import Control.Monad.IO.Class | |
import Data.Text.Lazy | |
routes :: ScottyM () | |
routes = do | |
get "/suid" suid | |
suid :: ActionM() | |
suid = do | |
ty <- liftIO timer | |
text $ pack ty | |
timer :: IO String | |
timer = do | |
zt <- getZonedTime | |
return $ formatTime defaultTimeLocale "%Y%m%d%H%M%S" zt | |
main :: IO () | |
main = scotty 7200 routes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment