old-locale-1.0.0.7: locale library

Copyright | (c) The University of Glasgow 2001
License | BSD3 (see LICENSE file)
Maintainer | libraries@haskell.org
Stability | stable
Portability | portable
Safe Haskell | Safe
Language | Haskell98

System.Locale

Description

This module provides the ability to adapt to local conventions.

At present, it supports only time and date information as used by `calendarTimeToString` from the `System.Time` module in the `old-time` package.

Synopsis

- data TimeLocale = TimeLocale {
  - wDays :: [(String, String)]
  - months :: [(String, String)]
  - intervals :: [(String, String)]
  - amPm :: (String, String)
  - dateTimeFmt, dateFmt, timeFmt, time12Fmt :: String
  }
- defaultTimeLocale :: TimeLocale
- iso8601DateFormat :: Maybe String -> String
- rfc822DateFormat :: String

# Documentation

data TimeLocale Source #

Constructors

TimeLocale |

Fields

- wDays :: [(String, String)]

  full and abbreviated week days

- months :: [(String, String)]

  full and abbreviated months

- intervals :: [(String, String)]
- amPm :: (String, String)

  AM/PM symbols

- dateTimeFmt, dateFmt, timeFmt, time12Fmt :: String

  formatting strings

#### Instances

Instances details

Eq TimeLocale Source # |
Instance details Defined in System.Locale Methods (==) :: TimeLocale -> TimeLocale -> Bool (/=) :: TimeLocale -> TimeLocale -> Bool
Ord TimeLocale Source # |
Instance details Defined in System.Locale Methods compare :: TimeLocale -> TimeLocale -> Ordering (<) :: TimeLocale -> TimeLocale -> Bool (<=) :: TimeLocale -> TimeLocale -> Bool (>) :: TimeLocale -> TimeLocale -> Bool (>=) :: TimeLocale -> TimeLocale -> Bool max :: TimeLocale -> TimeLocale -> TimeLocale min :: TimeLocale -> TimeLocale -> TimeLocale
Show TimeLocale Source # |
Instance details Defined in System.Locale Methods showsPrec :: Int -> TimeLocale -> ShowS show :: TimeLocale -> String showList :: [TimeLocale] -> ShowS

defaultTimeLocale :: TimeLocale Source #

iso8601DateFormat :: Maybe String -> String Source #

Construct format string according to ISO-8601.

The `Maybe String` argument allows to supply an optional time specification. E.g.:

    iso8601DateFormat Nothing            == "%Y-%m-%d"           -- i.e. YYYY-MM-DD
    iso8601DateFormat (Just "%H:%M:%S")  == "%Y-%m-%dT%H:%M:%S"  -- i.e. YYYY-MM-DDTHH:MM:SS

rfc822DateFormat :: String Source #

Format string according to RFC822.