V
V
Vasya Pupkin2015-06-02 23:53:16
MongoDB
Vasya Pupkin, 2015-06-02 23:53:16

How to properly specify date format in MongoDB?

Good afternoon!
I create a database:

var RoomSchema = new mongoose.Schema({
created: {
        type: Date,
        default: Date.now
    }
});

when checking, it turns out that it shows only in English format (with words). Is it possible to somehow give the format something like this: 2/06/2015 ??????

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Shikanov, 2015-06-03
@dizballanze

Mongoose returns a perfectly normal Date object . You can format the output yourself:
Or use ready-made modules like this .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question