SQL PHP HTML ASP JavaScript articles and free scripts to download
 

toDateString()

To convert date object to a string we have to use toDateString function. The output we will get is a string. Here is the syntax

Date.toDateString

Here is an example.

<script type="text/javascript">
var dt= new Date();
document.write(dt + "<br><br>");
document.write(dt.toDateString());
</script>

The output of the above code is here.

Note that before applying any string functions to date object we must convert it to string. The line bellow will generate error message

document.write(dt.substr(5)); // error

dt in above code is a date object so we can't use like this

Found anything wrong or wants to improve the code by adding more features? Post your short comment here or use the Forum



Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked

Join Our Email List
Email:  
For Email Newsletters you can trust
Date & Time
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2013 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer