Zero struct tm before calling strptime. This is necessary because if the format string does not contain enough conversion specifications to completely specify the resulting struct tm, the unspecified members of tm are left untouched.