TryGhost/Ghost

View on GitHub
ghost/data-generator/lib/utils/database-date.js

Summary

Maintainability
A
0 mins
Test Coverage
module.exports = function dateToDatabaseString(date) {
    if (typeof date === 'string') {
        // SQLite fix when reusing other dates from the db
        return date;
    }
    return date.toISOString().replace('Z','').replace('T', ' ');
};