Wednesday, May 07, 2025

Breaking News
>> Securing and encrypt View State and Cookies values  >> Page has one or more controls that do not correspond with   >> “The Controls collection cannot be modified because the control contains code blocks”  >> How to fix "Validation(): Element 'xxxx' is not supported  >> How to create a new session in ASP.NET programmatically  >> MySQL Database Backup using mysqldump command    

Editors Picks

Wednesday, November 30, 2011

How to find difference between two Dates in C#

How to find difference between two Dates in C#

DateTime sdate = DateTime.Now;
DateTime edate = DateTime.Parse("30/11/2011", CultureInfo.CreateSpecificCulture("fr-FR"));

TimeSpan ts = edate - sdate;
int days = ts.Days;
if (days>=0)
{ }
Else
{ }

 

No comments :

Post a Comment

Contact Us

Name

Email *

Message *