Adding utility functions for date calculations