Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

asp net c# compare date to current

string date = "01/04/2013";
                DateTime myDate = DateTime.ParseExact(date, "dd/MM/yyyy",
                                           System.Globalization.CultureInfo.InvariantCulture);
                if (myDate > DateTime.Today)
                {
                    Console.WriteLine("greater than");
                }
               else
                {
                 Console.WriteLine("Less Than");
                }
Comment

C# compare date values

var target = DateTime.Parse("3/25/2020");
var todaysDate = DateTime.Today;

if(target > todaysDate)
{
    Console.WriteLine("Hello World!");
}
else 
{
    Console.WriteLine("Too Bad");
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: add object to list c# 
Csharp :: dictionary c# iterate 
Csharp :: c# string remove special characters 
Csharp :: unity keycode for f 
Csharp :: how to split concat string c# 
Csharp :: topdown unity 
Csharp :: how to make a mouse down condition in C# 
Csharp :: how unsort the data table options 
Csharp :: return json from controller c# 
Csharp :: Get key by his value on Dict C# 
Csharp :: Cursor Lock and Visible in Unity 
Csharp :: c# convert split to list 
Csharp :: xamarin hide back button 
Csharp :: restart level unity 
Csharp :: c# print multiplication table 
Csharp :: where did mark twain go to school 
Csharp :: c# read authorization header 
Csharp :: unity c# foreach 
Csharp :: if number negative c sharp 
Csharp :: c# remove items from one list that are in another 
Csharp :: c# print list 
Csharp :: c# save pdf to folder 
Csharp :: how to open website from c# program 
Csharp :: c# regex find number in string 
Csharp :: how to add item in list at first position c# 
Csharp :: debug.log 
Csharp :: instantiate unity in parent 
Csharp :: c# select first value from list 
Csharp :: unity find object by name recursion 
Csharp :: single line and multiline comments in c# 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =