Scalar datetime64 and timedelta64 support

Is this function copied from numpy?  Should we get rid of it?