Desinger-System / mock-date.js
o134's picture
Upload folder using huggingface_hub
1804b24 verified
Raw
History Blame Contribute Delete
341 Bytes
import Database from 'better-sqlite3';
const db = new Database('local.db');
const pastDate = new Date();
pastDate.setMonth(pastDate.getMonth() - 1);
const result = db.prepare("UPDATE tasks SET created_at = ? WHERE id = (SELECT id FROM tasks ORDER BY id ASC LIMIT 1)").run(pastDate.getTime());
console.log('Updated rows:', result.changes);