helper method for date/time formatting