简体   繁体   中英

how do I change format of Date using javascript?

I want to display date as 18-03-2016 using javascript datepicker.If I didnot mention any format it is displaying as 03-18-2016.How to display like 18-03-2016. this is sample code

Try this

new JsDatePick({
        useMode:2,
        target:"startdate",
        dateFormat:"%d-%m-%Y"
    });

As described here: enter link description here

you can add this

new JsDatePick({
 useMode:2,
 target:"startdate",
 dateFormat:"%Y-%m-%d"
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM