| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.Time.Hora.Format
- ymd :: TimeZone -> UTCTime -> Tz String
- formatUTCTime :: String -> UTCTime -> String
- hmsFraction :: String
- hmsFraction' :: String
- ymdHms :: String
- spicoFormat :: String
- partFormats :: DmyHm String
Documentation
Arguments
| :: String | see |
| -> UTCTime | |
| -> String |
format UTCTime just as you need it. uses defaultTimeLocale
import Text.Regex.Do.Replace.Template
import Prelude hiding ((<),(>))
...
it "formatUTCTime" $ do
t1 <- getCurrentTime
let p1@DmyHm{..} = partFormats
traceIO $ formatUTCTime (("{day}/{month} {hour}:{minute}") <
[("day",day),("month",month),("hour",hour),("minute",minute)])
t1
12/12 18:39
hmsFraction :: String Source #
%T%Q
hmsFraction' :: String Source #
%T %Q
spicoFormat :: String Source #
%S.%-q
second.pico
partFormats :: DmyHm String Source #
some formats no padding
see formatTime for full measure
day %-d month %-m year %Y hour %-H minute %-M