How to use date-time - 3 common examples

To help you get started, we’ve selected a few date-time examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github luc-tuyishime / Questioner / controllers / meetups.js View on Github external
exports.create = (req, res) => {

    const meetupCreate = {
        createdOn: dateTime(),
        location: req.body.location,
        topic: req.body.topic,
        happeningOn: req.body.happeningOn,
        tags: req.body.tags
    };
    db.query("INSERT INTO meetup (createdon, location, topic, happeningon, tags) VALUES ($1,$2,$3,$4,$5) returning *", [
        meetupCreate.createdOn, meetupCreate.location, meetupCreate.topic, meetupCreate.happeningOn, meetupCreate.tags
    ], (err, result) => {
        if (err) {
            return res.status(500).json(err);
        }
        return res.status(200).json({
            status: 200,
            data: result.rows
        });
    });
github luc-tuyishime / Questioner / controllers / meetups.js View on Github external
exports.Upcoming = (req, res) => {
    const currentTime = dateTime();
    db.query('SELECT * FROM meetup WHERE happeningon > $1', [currentTime], (err, result) => {
        if (err) {
            throw err;
        }
        res.status(200).json({
            status: 200,
            data: result.rows
        });
    });
};
github alibaba / ice / packages / iceworks-client / src / utils / goldlog.js View on Github external
function goldlog(data = {}) {
  data.visit_time = dateTime();
  data.UA = UA;

  return axios({
    method: 'post',
    url: `${appConfig.apiUrl}goldlog/record`,
    data,
  });
}

date-time

Pretty datetime: `2014-01-09 06:46:01`

MIT
Latest version published 4 years ago

Package Health Score

65 / 100
Full package analysis

Popular date-time functions