Replace homemade function with DateTime module for ISO 8601