How to send timestamp in Express js json response?
You can use moment.js (as suggested by @swapnesh). But I found it more suitable to simply save the data as a timestamp. Since I'm using mongoDB I'm using Number for the data type.
So my schema looks something like this:
var myDataSchema = { start: {type: Number, required: "myDataSchema.start is a required field"},}
This will output:
{ "_id": "564c6828d4f028236cf1a6c8", "start": 1450969200}