vformat-time-0.1.0.0: Extend vformat to time datatypes

Safe HaskellSafe
LanguageHaskell2010

Text.Format.Time

Contents

Description

This module extend vformat to FormatTime datatypes

The specs of FormatTime is same as the second argument of "Data.Time.Format.formatTime".

Examples

>>> utc <- getCurrentTime
>>> zoned <- getZonedTime
>>> let locale = utcToLocalTime (zonedTimeZone zoned) utc
>>> format "{} / {} / {}" utc zoned locale
"2020-01-21 05:54:41.137832 / 2020-01-21 13:54:45.310354 CST / 2020-01-21 13:54:41.137832"
>>> format "{:%Y-%m-%dT%H:%M:%S}" utc
"2020-01-21T05:54:41"
Synopsis

Documentation

formatTimeLocale :: FormatTime t => TimeLocale -> t -> Formatter Source #

Formatter for FormatTime values using a specific TimeLocale.

formatTime :: FormatTime t => t -> Formatter Source #

Formatter for FormatTime values using the defaultTimeLocale.

Orphan instances

FormatArg ZonedTime Source #

Default specs is %F %T%Q %Z

Instance details

FormatArg LocalTime Source #

Default specs is %F %T%Q

Instance details

FormatArg TimeOfDay Source #

Default specs is %T

Instance details

FormatArg TimeZone Source #

Default specs is %Z

Instance details

FormatArg UniversalTime Source #

Default specs is %F %T%Q

Instance details

FormatArg UTCTime Source #

Default specs is %F %T%Q

Instance details

FormatArg Day Source #

Default specs is %F

Instance details