C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Compare Dates in JavaScript


Posted Date: 19 Jun 2008    Resource Type: Code Snippets    Category: Date & Time

Posted By: Subodh kumar Prajapati       Member Level: Gold
Rating:     Points: 4



The following JavaScript code can be used to compare two dates.


function dt()
{
var ch=Date.parse("06/19/2008");

var currentdt=new Date;
if(ch>Date.parse(currentdt))
{
alert("Date is greater.");
}
else
{
alert("Date is less");
}
}


It is important to note that the two date objects are being compared with the relational operators. Also, the Date.parse() method is a utility method that parses a string to a common date format.




Responses


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

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Date Comparison in Javascript  .  Compare dates with relational operators  .  Compare Dates in Javascript  .  Compare Dates  .  

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: Get total number of days between two months in different year
Previous Resource: AddDays method of a DateTime object
Return to Discussion Resource Index
Post New Resource
Category: Date & Time


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

budget conference call

Contact Us    Privacy Policy    Terms Of Use