Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Valid date check with DateTime.TryParse method

DateTime fromDateValue;
string s = "15/07/2012";
var formats = new[] { "dd/MM/yyyy", "yyyy-MM-dd" };
if (DateTime.TryParseExact(s, formats, CultureInfo.InvariantCulture, DateTimeStyles.None, out fromDateValue))
{
    // do for valid date
}
else
{
    // do for invalid date
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: Linq join update without creating new 
Csharp :: RemoveClaim 
Csharp :: An error occurred while deserializing the property of class Truncation resulted in data loss. 
Csharp :: how to add multiple values in session in asp.net visual studio 
Csharp :: c# how to start an application and detect if started 
Csharp :: unity editor window mesh field 
Csharp :: hacker typer.com 
Csharp :: ef core unique index 
Csharp :: .net core get exe path 
Csharp :: report background worker 
Csharp :: how to declare two int variables in only one line c# 
Csharp :: how to handle list properties in c# of string type 
Csharp :: getString 
Csharp :: Difference between Math.Floor() and Math.Truncate() 
Csharp :: split array into pieces of x length c# 
Csharp :: dotnet.com 
Csharp :: palindromes 
Csharp :: javas 
Csharp :: loop c# 
Csharp :: transform.rotate unity 2d 
Csharp :: unity iap 
Csharp :: Nullable Types unity 
Csharp :: how crate cron netapp 
Csharp :: generate random string 
Html :: removing filepath from url using htaccess 
Html :: bootstrap cdn link 
Html :: how to embed my website into Discord 
Html :: bootstrap circle button 
Html :: how to switch between html pages 
Html :: bootstrap div vertical center 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =