Get yyyy/mm/dd from javascript date object

by Jayanthi 2012-06-05 16:58:40

Get yyyy/mm/dd from javascript date object


<script type="text/javascript">

var today=new Date();
alert(today);

var month = today.getUTCMonth();
var day = today.getUTCDay();
var year = today.getUTCFullYear();

newdate = year + "/" + month + "/" + day;
alert(newdate);

</script>
809
like
0
dislike
0
mail
flag

You must LOGIN to add comments