C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Javascript »

JavaScript: Display the Local date


Posted Date: 01 Jul 2009    Resource Type: Code Snippets    Category: Javascript
Author: Viji RAJKUMARMember Level: Diamond    
Rating: 1 out of 5Points: 5



The following JavaScript Code snippet is used to display the Local date.

/* This function displays the date in
Format */

/*For Today it will display Wednesday 1 Jul 2009



function getLocalDate()
{
var now = new Date();
var day = now.getDay();
var date = now.getDate();
var month = now.getMonth();
var year = now.getFullYear();

var DOW=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");

var MON=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

return DOW[day] + ' ' + date + ' ' + MON[month] + ' ' + year;
}




SAMPLE USAGE

< font face="Tahoma" size="1" color="#ffffff" >
< script language="javascript" >

document.write(getLocalDate());

< /script >
< /font >

OUPUT

Wednesday 1 Jul 2009





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
JavaScript: Display the Local date  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: To find the cursor position in a textbox
Previous Resource: Change DropDownList's SelectedText colour using JavaScript
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use