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
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
 
 
  Calculating Date Difference in C Sharp  
  Sunday, April 4, 2010  
 

Calculating Date Difference in C Sharp

Code Sample: Calculating the Date Difference - Subtract Method.


using System;
using System.Collections.Generic;
using System.Text;

namespace Console_DateTime
{
class Program
{
static void Main(string[] args)
{
System.DateTime dtTodayNoon = new System.DateTime(2006, 9, 13, 12, 0, 0);
System.DateTime dtTodayMidnight = new System.DateTime(2006, 9, 13, 0, 0, 0);
System.TimeSpan diffResult = dtTodayNoon.Subtract(dtYestMidnight);
Console.WriteLine("Yesterday Midnight - Today Noon = " + diffResult.Days);
Console.WriteLine("Yesterday Midnight - Today Noon = " + diffResult.TotalDays);
Console.ReadLine();
}
}
}
Back Main

Labels:

 
  posted by Rz Rasel At 3:15 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