Default usage with current UTC dateconst formattedDate = getTimestamp(); // "2024-09-26-15-30-45" Copy
Default usage with current UTC dateconst formattedDate = getTimestamp(); // "2024-09-26-15-30-45"
Custom separatorconst formattedDate = getTimestamp({ separator: '/' }); // "2024/09/26/15/30/45" Copy
Custom separatorconst formattedDate = getTimestamp({ separator: '/' }); // "2024/09/26/15/30/45"
Custom date with only year, month, and dayconst formattedDate = getTimestamp({ date: new Date('2023-12-01T08:22:33Z'), includeHours: false, includeMinutes: false, includeSeconds: false }); // "2023-12-01" Copy
Custom date with only year, month, and dayconst formattedDate = getTimestamp({ date: new Date('2023-12-01T08:22:33Z'), includeHours: false, includeMinutes: false, includeSeconds: false }); // "2023-12-01"
Custom date with only hours, minutes, and secondsconst formattedDate = getTimestamp({ date: new Date('2023-12-01T08:22:33Z'), includeYear: false, includeMonth: false, includeDay: false }); // "08-22-33" Copy
Custom date with only hours, minutes, and secondsconst formattedDate = getTimestamp({ date: new Date('2023-12-01T08:22:33Z'), includeYear: false, includeMonth: false, includeDay: false }); // "08-22-33"
Example
Example
Example
Example