jQuery Date formate

Add this function to your <script></script> and call from where ever you want in that <script></script>

<script>

window.alert(Getnow());

function GetNow(){
            var currentdate = new Date(); 
            var datetime = currentdate.getDate() + "-"
                    + (currentdate.getMonth()+1)  + "-" 
                    + currentdate.getFullYear() + " "  
                    + currentdate.getHours() + ":"  
                    + currentdate.getMinutes() + ":" 
                    + currentdate.getSeconds();
            return datetime;
        }
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *