Skip to content

Commit

Permalink
Fix timestamp issue
Browse files Browse the repository at this point in the history
  • Loading branch information
grantfitzsimmons committed Oct 30, 2024
1 parent 2279e61 commit 33dc880
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/pages/api/databases/[name]/clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export default async function handler(

try {
// Generate a new database name with timestamp
const timestamp = new Date().toISOString().replace(/T/, '_').replace(/:/g, '_').split('.')[0];

const now = new Date();
const timestamp = `${now.getFullYear()}_${String(now.getMonth() + 1).padStart(2, '0')}_${String(now.getDate()).padStart(2, '0')}_${String(now.getHours()).padStart(2, '0')}_${String(now.getMinutes()).padStart(2, '0')}_${String(now.getSeconds()).padStart(2, '0')}`;
const newDatabaseName = `${existingDatabaseName}_${timestamp}`;

// Create the new database
Expand Down

0 comments on commit 33dc880

Please sign in to comment.