toString()

Before applying any string functions to the date object we must convert it to string by using toString function.
Date.toString();
Sample code
<script type="text/javascript"> 
var dt= new Date();
document.write(dt + "<br><br>");
document.write(dt.toString());
</script>
The output is here

After conversion to string we can apply any string function like this .
document.write(dt.toString().substr(5));

Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com




    Post your comments , suggestion , error , requirements etc here .




    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer