def __to_localdatetime(val):
try:<EOL><INDENT>dt = datetime.strptime(val, __DATE_FORMAT)<EOL>dt = pytz.timezone(__TIMEZONE).localize(dt)<EOL>return dt<EOL><DEDENT>except (ValueError, TypeError):<EOL><INDENT>return None<EOL><DEDENT>
Convert val into a local datetime for tz Europe/Amsterdam.