Added a simple function to return intervals.

Added a function to return the set of timestamps closest to the
current date given. Added a single unit test to verify that it is
working correctly.