Move common date functions into separate namespace