Amoraboti - Program
Rashed - Uz - Zaman (Rasel)
  Home About Me Brainstorming Facebook Fan Page Contact    
  Author
I'm Rz Rasel
From Bangladesh

  Archives
April 2010
May 2010
January 2011
February 2011
January 2012
February 2012
March 2012

  Current

  Previous Posts
Calculating Date Difference in C Sharp
Without SSL connection, Normal SMTP Java
Fetch Mail through a proxy server (Gmail) Java
Send Mail through a proxy server (Gmail) Java
Sending Email From Your Application Using Java Mail
Link

  My Link
Islam And We
My Diary (Bangla)
My Diary (English)
My Lyrics (Bangla)
My Lyrics (English)
My Poem (Bangla)
My Poem (English)
My Story (Bangla)
My Story (English)
General Knowledge
Fun And Jokes
Lyrics (Bangla)
Lyrics (English)
Lyrics (Hindi)
Quotations
 
 
  Find Difference Between Two Dates In C Sharp  
  Sunday, April 4, 2010  
 

find difference between two dates in C Sharp


Code Sample: find difference between two dates.


// Start date
DateTime startDate = new DateTime(2005, 2, 1, 3, 4, 12, 56);
// End date
DateTime endDate = new DateTime(2005, 12, 12, 4, 30, 45, 12);
// Time span
TimeSpan diffDate = endDate.Subtract ( startDate );
// Spit it out
Console.WriteLine( "Time Difference: ");
Console.WriteLine(diffDate.Days.ToString() + " Days");
Console.WriteLine(diffDate.Hours.ToString() + " Hours" );
Console.WriteLine(diffDate.Minutes.ToString() + " Minutes");
Console.WriteLine(diffDate.Seconds.ToString() + " Seconds ");
Console.WriteLine(diffDate.Milliseconds.ToString() + " Milliseconds ");

Back Main

Labels:

 
  posted by Rz Rasel At 3:22 AM,

0 Comments:

Post a Comment

<< Home

 
     
 
  Problem In Font
Download then zip file unzip and install in your system. Or normal font file just install in your system font folder. Rz Rasel
Bangla Font
Bangla Font

  Find Me In Facebook
 
 

   aaaa
 

   aaaa
 
 
Copyright © 2010 - Amoraboti - Program. ® All right reaserved. Design and developed by:- Rz Rasl