API การลา 01-03
This commit is contained in:
parent
32686c3e0b
commit
cffb53c1f5
29 changed files with 6391 additions and 4 deletions
|
|
@ -12,6 +12,15 @@ namespace BMA.EHR.Domain.Extensions
|
|||
|
||||
#region " Public "
|
||||
|
||||
public static int DiffDay(this DateTime startDate, DateTime endDate)
|
||||
{
|
||||
if (endDate < startDate)
|
||||
{
|
||||
throw new ArgumentException("End Date must greater than start date.");
|
||||
}
|
||||
return (int)(endDate.Date - startDate.Date).TotalDays;
|
||||
}
|
||||
|
||||
public static double DiffYear(this DateTime currentDate)
|
||||
{
|
||||
return (DateTime.Today - currentDate).TotalDays / 365.2425;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue