Display current date : Date : Development JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Development » Date »

 

Display current date




<html>
<head>
</head>

<body>
<script>
    var mydate=new Date()
    var year=mydate.getYear()
    
    if (year < 1000)
        year+=1900
    
    var day=mydate.getDay()
    var month=mydate.getMonth()+1
    
    if (month<10)
        month="0"+month
    
    var daym=mydate.getDate()
    if (daym<10)
        daym="0"+daym
    
    document.write(year+"/"+month+"/"+daym)

</script>
</body>

</html>




           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Development
» Date