chronos-0.3: A time library, encoding, decoding, and instances

Safe HaskellNone
LanguageHaskell2010

Chronos.TimeOfDay.ByteString.Char7

Description

Functions for encoding TimeOfDay to ByteString. Any encoding that is a superset of ASCII is compatible with the functions in this module. This includes UTF-8 and ISO-8859-15 but does not include UTF-16 or UTF-32.

Synopsis

Documentation

builder_HMS :: SubsecondPrecision -> Maybe Char -> TimeOfDay -> Builder Source

This could be written much more efficiently since we know the exact size the resulting Text will be.

parser_HMS_opt_S :: Maybe Char -> Parser TimeOfDay Source

Parses text that is formatted as either of the following:

  • %H:%M
  • %H:%M:%S

That is, the seconds and subseconds part is optional. If it is not provided, it is assumed to be zero. This format shows up in Google Chrome's datetime-local inputs.