Reformatted date generation. Moved logic to static function