herf-time: haskell time manipulation in a 'kerf like' style.
This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.
The herf-time package attempts to make the time package's syntax more straightforward for doing interval math and conversion. It borrows heavily from the syntax of the kerf programming language https://github.com/kevinlawler/kerf . But unlike kerf, there are no promisses of high performance code here. The performance seems adequate for lots of uses though and manipulating time in the herf library is pretty fun.
The KerfTime
module is self contained and the only dependency is the time package.
Add intervals of varying amounts.
date 2016 01 01 `add` hour 3 `add` week 16 `add` month 3 :: UTCHerfTime
UTCHerfTime 2016-07-22 03:00:00 UTC
Subtract intervals as well
date 2016 01 01 `add` hour (-3) `add` week (-16) `add` month (-3) :: UTCHerfTime
UTCHerfTime 2015-06-10 21:00:00 UTC
Use the same interval notation for different time representation
dateTime 2016 01 01 01 23 01 `add` (hour 3) `add` (week 16) `add` (month 3) :: UTCHerfTime
UTCHerfTime 2016-07-22 04:23:01 UTC
(reherf $ ( dateTime 2016 01 01 01 01 01 :: HerfZonedTime "CST")) :: HerfZonedTime "PST"
2015-12-31T23:01:01:PST
zt <- getZonedTime
herfShow zt
"2016-01-21T11:29:05:CST"
reherfz zt :: HerfZonedTime "PST"
2016-01-21T09:29:05:PST
reherfz zt :: HerfZonedTime "+0600"
2016-01-21T23:29:05:+0600
reherfz zt :: HerfZonedTime "CST"
2016-01-21T11:29:05:CST
(reherfz zt) `add` month 2 :: HerfZonedTime "CST"
2016-03-21T11:29:05:CST
(reherfz zt) `add` month 2 :: HerfZonedTime "PST"
2016-03-21T09:29:05:PST
[Skip to Readme]
Properties
Versions | 0.1.0, 0.2.0, 0.2.2, 0.3.0, 0.3.1, 0.3.1 |
---|---|
Change log | ChangeLog.md |
Dependencies | base (>=4 && <5), time [details] |
License | BSD-3-Clause |
Author | Scott Murphy <scottmurphy09@gmail.com> |
Maintainer | Scott Murphy <scottmurphy09@gmail.com> |
Category | Time, Kerf |
Source repo | head: git clone https://github.com/smurphy8/herf-time |
Uploaded | by scottmurphy09 at 2020-04-28T17:42:27Z |
Modules
[Index] [Quick Jump]
Downloads
- herf-time-0.3.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
Package maintainers
For package maintainers and hackage trustees