Yes. It is pretty simple. You can use the date object as follows:
var d = new Date();
var mm = d.getMonth() + 1;
var dd = d.getDate();
var yy = d.getFullYear();
Then you should have the numbers necessary to form a string in any format.
var myDateString = yy + '-' + mm + '-' + dd;
Please note that this will give something like 2015-1-2, if the numbers are in single digits, if you need 2015-01-02, then you will need further conversion.
Also note that this will only give the “customer” date, i.e. date in the user system. It should be in your local time. If you need server time, you will have to have some kind of api to call.
source
share