first time include all file
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace CarParkValidationAPI.Helpers;
|
||||
|
||||
public class Helper
|
||||
{
|
||||
public static string DateToStr(DateTime? date)
|
||||
{
|
||||
string result = "";
|
||||
if (date != null)
|
||||
result = date?.ToString("yyyy-MM-dd");
|
||||
return result;
|
||||
}
|
||||
|
||||
public static DateTime StrToDate(string date)
|
||||
{
|
||||
DateTime result = DateTime.Today;
|
||||
if (DateTime.TryParse(date, out var dt))
|
||||
{
|
||||
result = dt;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user