how to get current date in express js

const express = require('express');
const app = express();

app.get('/currentdate', (req, res) => {
  const currentDate = new Date();
  res.send(`Current date: ${currentDate.toDateString()}`);
});

const PORT = 3000;
app.listen(PORT, () => {
  console.log(`Server is running on port ${PORT}`);
});