Pages

Thursday, 6 July 2017

Java Script Date dd/mm/yyyy format

Get Java Script Date dd/mm/yyyy format

<html>
<head>
    <title>Girfa Student Help</title>
    <script>
        function GetDate()
        {
            var d = new Date();

            s1.innerHTML = d.getDate() + "/" + (parseInt(d.getMonth()) + 1) + "/" + d.getFullYear();
        }
    </script>
</head>
<body>
    <input type="button" value="Get Date" onclick="GetDate()"/>
    <span id="s1"></span>
</body>

</html>

No comments:

Post a Comment