It is trivial to do the less than 24 hours thing. Just store the value in timestamp format when the person logs in and retrieve it later (
). That way you can retrieve it when you are determining the cut off. As far as converting a date into a timestamp - yes it is possible without modules or the module itself wouldn't be possible.
is very fast because it uses a C backend.
basically just uses convergence by guessing at the time and then lowering/highering values until it locks in on its target. It also uses a cache to make repeated checks of the same month faster, so I wouldn't suggest re-inventing these wheels.