Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get diff btw datetimes two C#

 int totalDays = Convert.ToInt32((DateTime.UtcNow.Date - myDateTime.Date).TotalDays);
Comment

c# how to compare 2 dates without time

if(dateTime1.Date == dateTime2.Date)
  // or 
if (dateTime1.Date.CompareTo(dateTime2.Date))
{
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: bitmap to imagesource c# 
Csharp :: switch case c# 
Csharp :: o(n*m) 
Csharp :: c# csv read write 
Csharp :: Unity Destroy gameObject upon collision 
Csharp :: c# foreach on a dictionary 
Csharp :: list.max c# 
Csharp :: read all lines from txt c# 
Csharp :: c# enum to int array 
Csharp :: httpwebrequest c# example 
Csharp :: c# inline array initialization 
Csharp :: how to store an array inside an array c# 
Csharp :: c# create dynamic json 
Csharp :: get width of image unity 
Csharp :: what is type unity 
Csharp :: raycasting in unity 
Csharp :: c# get country code 
Csharp :: c# get folder path from file path 
Csharp :: Convert array of strings to List<string 
Csharp :: count number of properties on an object C# 
Csharp :: max value data annotation c# 
Csharp :: generate qr code c# 
Csharp :: c# remove rows from datatable 
Csharp :: adding values to mock IHttpContextAccessor unit test .net core 
Csharp :: vector3 unity 
Csharp :: check two lists are equal c# 
Csharp :: file to byte array 
Csharp :: how to check if List<T element contains an item with a Particular Property Value in c# 
Csharp :: convert decimal to 2 decimal places c# 
Csharp :: how to check if the value is alphabet and numbers only only in c# 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =