def parse_ls_date(self, s, *, now=None):
with setlocale("<STR_LIT:C>"):<EOL><INDENT>try:<EOL><INDENT>if now is None:<EOL><INDENT>now = datetime.datetime.now()<EOL><DEDENT>d = datetime.datetime.strptime(s, "<STR_LIT>")<EOL>d = d.replace(year=now.year)<EOL>diff = (now - d).total_seconds()<EOL>if diff > HALF_OF_YEAR_IN_SECONDS:<EOL><INDENT>d = d.replace(year=now.year + <NUM_LIT:1>)<EOL><DEDENT>elif diff < -HALF_OF_YEAR_IN_SECONDS:<EOL><INDENT>d = d.replace(year=now.year - <NUM_LIT:1>)<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>d = datetime.datetime.strptime(s, "<STR_LIT>")<EOL><DEDENT><DEDENT>return self.format_date_time(d)<EOL>
Parsing dates from the ls unix utility. For example,
"Nov 18  1958" and "Nov 18 12:29".

:param s: ls date
:type s: :py:class:`str`

:rtype: :py:class:`str`