Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# datediff minutes

using System;
using System.Linq;
public class Demo {
   public static void Main() {
      DateTime date1 = new DateTime(2018, 7, 15, 08, 15, 20);
      DateTime date2 = new DateTime(2018, 8, 17, 11, 14, 25);
      TimeSpan ts = date2 - date1;
      Console.WriteLine("No. of Minutes (Difference) = {0}", ts.TotalMinutes);
   }
}
Output
No. of Minutes (Difference) = 47699.0833333333
Comment

c# datediff minutes


DateTime startTime = varValue
DateTime endTime = varTime

TimeSpan span = endTime.Subtract ( startTime );
Console.WriteLine( "Time Difference (minutes): " + span.TotalMinutes );

Comment

c# datediff

(EndDate - StartDate).TotalDays
Comment

PREVIOUS NEXT
Code Example
Csharp :: fill dictionary c# 
Csharp :: C# Async Function without await 
Csharp :: create enum from int c# 
Csharp :: hide external app from taskbar 
Csharp :: linq select 
Csharp :: change object position 
Csharp :: install active directory windows server 2019 powershell 
Csharp :: c# getting response content from post 
Csharp :: Check if list contains any of another list 
Csharp :: c# square symbol 
Csharp :: Transpose Matrix C# 
Csharp :: loop in c# 
Csharp :: unity fixedupdate 
Csharp :: admob unity 
Csharp :: overridable method C# 
Csharp :: get camera position unity 
Csharp :: change tab to enter in c# form 
Csharp :: Delayed respawn timer 
Csharp :: c# compare months 
Csharp :: wpf button to return to last window 
Csharp :: what is napalm made of 
Csharp :: unity set dictionary value 
Csharp :: deploy c# applications on ubuntu 
Csharp :: C# program to find sum of array elements 
Csharp :: show double in textbox c# 
Csharp :: add dynamic value in startup file in .net core api 
Csharp :: how to make dissapear an object in unity 
Csharp :: tostring vb.net format decimal value with comma 
Csharp :: c# language 
Csharp :: SerializedObjectNotCreatableException: Object at index 0 is null 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =