hora-2.2.0: date time

Safe HaskellNone
LanguageHaskell2010

Data.Time.Hora.Format

Contents

Synopsis

type

data Format Source #

*0: 0 padded

see formatTime

Constructors

Raw String 
Tab 
Crlf

new line

Offset

time zone

Zone

time zone name

Hm

%H:%M

Hms

%H:%M:%S

AM

AM PM

Am

am pm

H_24

24-hour *0

H_12

12-hour *0

Min

minute *0

S

second *0

Fraction_fixed

pico precision *0

Fraction

.12 for 0.12 second. Pico precision, no trailing 0

Y_m_d

%Y-%m-%d

Y

year

Month

month name long

Mth

month name short

Mth_1_12

month *0

D

day *0

D_wk_1_7

day of week for Week Date format, 1 - 7

D_wk_0_6

day of week number, 0 (= Sunday) - 6 (= Saturday)

D_wk

day of week short

D_week

day of week long

Wk_year_Sun

week of year start Sunday

Wk_year_Mon

week of year start Monday

Instances
IsString Format Source #

enter Raw String as ordinary String with

{-# LANGUAGE OverloadedStrings #-}      
Instance details

Defined in Data.Time.Hora.Format

Methods

fromString :: String -> Format #

format

format :: [Format] -> UTCTime -> String Source #

format as UTC

format' :: Tz' tz => [Format] -> tz -> UTCTime -> Tz String Source #

format as local time in specified timezone

show' :: DatePartSmall -> String Source #

pretty print DatePartSmall

incremental values are prefixed with + or -

>>> show' $ mkDay 2018 08 17
    2018-08-17
>>> show' $ mkMin 4 3
    04:03
>>> show' $ mkMs 7 318
    07.318
>>> let (Day d1) = mkDay 2018 08 17
        (Min m1) = mkMin 15 17
        (Ms ms1) = mkMs 7 358
    show' $ DatePartSmall d1 m1 ms1
    2018-08-17 15:17:07.358
>>> show' $ Day' 3
     +3
>>> show' $ toSpan $ mkMin 0 53
    +00:53
>>> show' $ toSpan $ mkMs 7 0
    +07.000
>>> show' $ T.negate $ Day' 3
    -3
>>> show' $ T.negate $ toSpan $ mkMin 14 53
    -14:53