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 :: how to move your character in unity 2d game 
Csharp :: get filename from path c# 
Csharp :: alert message in c# windows application 
Csharp :: unity flexiable space 
Csharp :: c# repeat string x times 
Csharp :: c# iformfile to string 
Csharp :: phone number regex in c# 
Csharp :: message box in visual studio 
Csharp :: c# generate random int in range 
Csharp :: c# int to byte array 
Csharp :: unity c# timer 
Csharp :: how to find how much digits in number c# 
Csharp :: asp.net core redirecttoaction with parameters 
Csharp :: search the third word in string in c# 
Csharp :: c# find index element array 
Csharp :: c# take only int from string 
Csharp :: snx disconnect linux 
Csharp :: restart animation unity 
Csharp :: xamarin timer example 
Csharp :: unity deadzone 
Csharp :: c# file exist 
Csharp :: c sharp int to string 
Csharp :: c# loading assembly at runtime 
Csharp :: blazor alert 
Csharp :: unity change color of sprite in script 
Csharp :: destroy gameobject unity 
Csharp :: how to have is trigger on but also have collisions 
Csharp :: Editor log location unity 
Csharp :: dart extending list 
Csharp :: small modal popup bootstrap 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =