如何在php语句中添加jquery变量数据? [重复]

This question already has an answer here:

i am getting stuck on this problem. i want to do using jquery

window.newdatevalue = '<?php echo date("Y-m-d") ?>';// this date is dynamic

var newdate = window.newdatevalue;

console.log(newdate); // when i print this it give me right result -2017-02-06 

var finaldate = "<?php echo date('d/M/y',strtotime('"+newdate+"'))?>";

console.log(finaldate); // but when i print this it give me wrong result 01/Jan/70 

Can anyone help me what i am doing wrong

</div>

Can try this. It might help you.

window.newdatevalue = '<?php echo date("d-m-Y", strtotime(date("Y-m-d"))); ?>'

console.log(window.newdatevalue);