options-time-1.0: Command-line option types for dates and times.

LicenseMIT
Safe HaskellSafe-Inferred
LanguageHaskell98

Options.Time

Description

The options-time package provides OptionType implementations and associated SimpleOption instances for types related to dates and times.

Synopsis

Documentation

optionType_duration :: OptionType DiffTime Source

Store an option as a DiffTime. The duration is specified in a format such as "2h30m" for two hours and thirty minutes.

Available units are:

  • "h" for hours.
  • "m" for minutes.
  • "s" for seconds.
  • "ms" for milliseconds.
  • "us" or "µs" for microseconds.
  • "ns" for nanoseconds.
  • "ps" for picoseconds.

Larger units are not available to avoid ambiguity when dealing with daylight savings time.

optionType_date :: OptionType Day Source

Store an option as a Day. Supported formats are:

  • "YYYY-MM-DD"
  • "YYYYMMDD"
  • "YYYY-DDD"

optionType_time :: OptionType TimeOfDay Source

Store an option as a TimeOfDay. Supported formats are:

  • "HH:MM"
  • "HH:MM:SS"
  • "HH:MM:SS.FFFF"

For example, the value "10:11:12.5" is half a second past 10:11:12 AM.

optionType_localTime :: OptionType LocalTime Source

Store an option as a LocalTime. Supported formats are a combination of those for optionType_date and optionType_time.

optionType_utcTime :: OptionType UTCTime Source

Store an option as a UTCTime. Supported formats are a combination of those for optionType_date and optionType_time.

optionType_zonedTime :: OptionType ZonedTime Source

Store an option as a ZonedTime. Supported formats are a combination of those for optionType_date and optionType_time.