real-day-end: Tiny library to calculate date considering when your day realy ends

[ bsd3, library, web ] [ Propose Tags ]

[Skip to Readme]
Versions 0.0.1
Dependencies base (>=4.6 && <5), time [details]
License BSD-3-Clause
Copyright 2017 Author name here
Author Author name here
Maintainer example@example.com
Category Web
Home page https://github.com/s9gf4ult/real-day-end
Source repo head: git clone https://github.com/s9gf4ult/real-day-end
Uploaded by AlekseyUymanov at Sun Nov 26 11:45:36 UTC 2017
Distributions NixOS:0.0.1
Downloads 235 total (8 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-11-26 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for real-day-end-0.0.1

[back to package description]

What?

Consider you are falling a sleep at 2:00am, so next day for you starts from 2:00, not from 0:00. So, if now is 2017-10-10T01:00 and you did not sleept yet, then this is still 2017-10-09 for you.

>>> let now = ZonedTime (LocalTime (fromGregorian 2017 10 10) (TimeOfDay 01 00 00)) utc
>>> now
2017-10-10 01:00:00 UTC
>>> realDay (TimeOfDay 0 0 0) now
2017-10-10
>>> realDay (TimeOfDay 2 0 0) now
2017-10-09

This function shifts day switch to the specified time. It may be useful for some logging software and similar stuff.