Click here to Skip to main content
15,914,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
How to change current date with specific format using javascript

var dateFormat = response.d; // response.d= DD/MM/YYYY OR MM/DD/YYYY OR YYYY/MM/DD ETC...
var cur = new Date(dateFormat);
document.getElementById("Stdate").value=cur;

my expected output should come based on the dateformate.
i tried the above code but it showing invalid date

so please drop me a solution for this.

thanks to all
regards,
stellus.

What I have tried:

How to change current date with specific format using javascript
Posted
Updated 7-Apr-18 3:19am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900