.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Code Snippets >> Javascript >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Javascript to getdate in mm/dd/yyyy format

Posted By:Maverick       Posted Date: July 21, 2011    Points: 40    Category: Javascript    URL: http://www.dotnetspark.com  

Javascript to getdate in mm/dd/yyyy format

Hello All,

The javascript below will return the date in mm/dd/yyyy format.

function GetDate() {
    var currentTime = new Date();
    var month = format(currentTime.getMonth() + 1);
    var day = format(currentTime.getDate());
    var year = format(currentTime.getFullYear());
    return month + "/" + day + "/" + year;

Hope it helps.


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend