Transforms date to int