Copyright | (c) 2013-2015 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
Stability | provisional |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Documentation
:: ParseTime t | |
=> TimeLocale | Time locale. |
-> String | Format string. |
-> String | Input string. |
-> Maybe t | The time value, or |
Parses a time value given a format string.
Supports the same %-codes as formatTime
, including %-
, %_
and %0
modifiers.
Leading and trailing whitespace is accepted. Case is not significant.
Some variations in the input are accepted:
%z
- accepts any of
-HHMM
or-HH:MM
. %Z
- accepts any string of letters, or any of the formats accepted by
%z
. %0Y
- accepts exactly four digits.
%0G
- accepts exactly four digits.
%0C
- accepts exactly two digits.
%0f
- accepts exactly two digits.