Further to my recent NLS-related pull requests, I have two utility functions that translate the date or time format pictures used by the Windows API (see here and here) to the nearest equivalent format strings used by Data.Time.Format.formatTime of the time package.
For example (for locale nl-NL), Windows format picture dddd d MMMM yyyy is translated to format string %A %-e %B %Y.
Currently, they are implemented in a fork of this repository. If this package is an appropriate place for them, I'll propose a pull request. My thinking was that a 'bridge' between the Windows API and the time package could usefully be included in this package, as time may be more Unix-centric.
They are:
-- | Translate from a Windows API day, month, year, and era format picture to
-- the closest corresponding format string used by
-- 'Data.Time.Format.formatTime'.
fromDateFormatPicture :: String -> Maybe String
-- | Translate from a Windows API hour, minute, and second format picture to
-- the closest corresponding format string used by
-- 'Data.Time.Format.formatTime'.
fromTimeFormatPicture :: String -> Maybe String
Further to my recent NLS-related pull requests, I have two utility functions that translate the date or time format pictures used by the Windows API (see here and here) to the nearest equivalent format strings used by
Data.Time.Format.formatTime
of thetime
package.For example (for locale
nl-NL
), Windows format picturedddd d MMMM yyyy
is translated to format string%A %-e %B %Y
.Currently, they are implemented in a fork of this repository. If this package is an appropriate place for them, I'll propose a pull request. My thinking was that a 'bridge' between the Windows API and the
time
package could usefully be included in this package, astime
may be more Unix-centric.They are: