Function dateindex added

This function should be tested.
Actually, since I am using datetime module this function isn't
necessary, but it can be useful in other projects such as csvgrep, for
example.