A parseInt on a date string, replaced with a parser that understands both formats.
संक्षिप्त उत्तर
Passman's generic CSV importer parsed date columns such as created and changed with parseInt(), so a date string became a tiny number and every entry ended up dated near January 1970. The fix keeps numeric epoch values, falls back to Date.parse() for date strings, and leaves the field untouched when the value is empty or unparseable. A maintainer then added OTP handling to the same importer. It was merged as PR #878 and closed issue #840.
The problem
Issue #840, on Nextcloud Hub 10, reported that after importing a CSV with the "created" and "changed" fields kept, "Every date was set to 0 (1970-01-01 01:33:43)".
The fix
var parseTimestampToSeconds = function (value) {
...
if (/^[+-]?\d+(\.\d+)?$/.test(rawValue)) {
return Math.floor(parseFloat(rawValue));
}
const parsedDate = Date.parse(rawValue);
return isNaN(parsedDate) ? null : Math.floor(parsedDate / 1000);
};
...
const seconds = parseTimestampToSeconds(row[k]);
if (seconds !== null) {
_credential[field] = seconds;
}
By the numbers
- Repository: nextcloud/passman, 829 stars (Nov 3, 2026), JavaScript, AGPL-3.0
- Files changed: 1
- Lines: +87 / -9 (the PR author's commit was +20 / -3; the maintainer's commit was +67 / -6)
- Commits: 2 (1 from the PR author, 1 from the maintainer)
- Opened: Aug 21, 2026. Merged: Aug 24, 2026. Time to merge: 2 days, 23 hours
- Review: approved and merged by the maintainer
How the review went
The maintainer added a commit, "enhance OTP handling in generic CSV importer", approved and merged the PR, and left a note covering this and the related importer PRs: "Thank you very much for the various importer improvements in this and your other pull requests".
अक्सर पूछे जाने वाले प्रश्न
Where can I read more?
See the pull request and the original issue.
लक्ष्य
When people migrate, the history matters as much as the secrets. Keeping created and changed dates intact makes an import trustworthy.