I think there's already a similar function for doing this in the date ISO file present in utils. Could you check?