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

[ bsd3, library, web ] [ Propose Tags ]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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 2017-11-26T11:45:36Z
Distributions NixOS:0.0.1
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 941 total (12 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-11-26 [all 1 reports]

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.