TimeUtils.GetAge method
Namespace | Skybrud.Essentials.Time |
---|---|
Assembly | Skybrud.Essentials.dll |
GetAge(DateTime, int, int, int)
Returns the age as calculated between then
and the date identified by the specified
year
, month
and day
.
public static int GetAge(DateTime then, int year, int month, int day)
Parameters
then
DateTime
The date.
year
int
The year of the date to compare against.
month
int
The year of the date to compare against.
day
int
The year of the date to compare against.
Returns
The calculated age between thespecified date and the current date.
GetAge(int, int, int, int, int, int)
Returns the age as calculated between two dates.
public static int GetAge(int year1, int month1, int day1, int year2, int month2, int day2)
Parameters
year1
int
The year of the first date.
month1
int
The month of the first date.
day1
int
The day of the first date.
year2
int
The year of the date to compare against.
month2
int
The month of the date to compare against.
day2
int
The day of the date to compare against.
Returns
The calculated age between the two dates.
GetAge(DateTime)
Returns the age as calculated between then
and the current date.
public static int GetAge(DateTime then)
Parameters
then
DateTime
The date of birth.
Returns
The age calculated between the current date and then
.
GetAge(DateTime, DateTime)
Gets the current age, from the specified dateOfBirth
. The age is calculated based on
compare
.
public static int GetAge(DateTime dateOfBirth, DateTime compare)
Parameters
dateOfBirth
DateTime
The date of birth.
compare
DateTime
The date used for calculating the age.
Returns
The age based on the specified dateOfBirth
at the moment of
compare
.
GetAge(DateTime, DateTimeOffset)
Gets the current age, from the specified dateOfBirth
. The age is calculated based on
compare
.
public static int GetAge(DateTime dateOfBirth, DateTimeOffset compare)
Parameters
dateOfBirth
DateTime
The date of birth.
compare
DateTimeOffset
The date used for calculating the age.
Returns
The age based on the specified dateOfBirth
at the moment of
compare
.
GetAge(DateTime, EssentialsDate)
Gets the current age, from the specified dateOfBirth
. The age is calculated based on
dt
.
public static int GetAge(DateTime dateOfBirth, EssentialsDate dt)
Returns
The age based on the specified dateOfBirth
at the moment of
dt
.
GetAge(DateTime, EssentialsDateTime)
Gets the current age, from the specified dateOfBirth
. The age is calculated based on
dt
.
public static int GetAge(DateTime dateOfBirth, EssentialsDateTime dt)
Returns
The age based on the specified dateOfBirth
at the moment of
dt
.
GetAge(DateTime, EssentialsTime)
Gets the current age, from the specified dateOfBirth
. The age is calculated based on
dt
.
public static int GetAge(DateTime dateOfBirth, EssentialsTime dt)
Returns
The age based on the specified dateOfBirth
at the moment of
dt
.
GetAge(DateTimeOffset)
Returns the age as calculated between then
and the current date.
public static int GetAge(DateTimeOffset then)
Parameters
then
DateTimeOffset
The date of birth.
Returns
The age calculated between the current date and then
.
GetAge(DateTimeOffset, DateTime)
Returns the age, from the specified then
. The age is calculated based on
compare
.
public static int GetAge(DateTimeOffset then, DateTime compare)
Parameters
then
DateTimeOffset
The date of birth.
compare
DateTime
The date used for calculating the age.
Returns
The age based on the specified then
at the moment of
compare
.
GetAge(DateTimeOffset, DateTimeOffset)
Returns the age, from the specified then
. The age is calculated based on
compare
.
public static int GetAge(DateTimeOffset then, DateTimeOffset compare)
Parameters
then
DateTimeOffset
The date of birth.
compare
DateTimeOffset
The date used for calculating the age.
Returns
The age based on the specified then
at the moment of
compare
.
GetAge(DateTimeOffset, EssentialsDate)
Gets the current age, from the specified then
. The age is calculated based on
compare
.
public static int GetAge(DateTimeOffset then, EssentialsDate compare)
Parameters
then
DateTimeOffset
The date of birth.
compare
EssentialsDate
The date used for calculating the age.
Returns
The age based on the specified then
at the moment of
compare
.
GetAge(DateTimeOffset, EssentialsDateTime)
Gets the current age, from the specified then
. The age is calculated based on
compare
.
public static int GetAge(DateTimeOffset then, EssentialsDateTime compare)
Parameters
then
DateTimeOffset
The date of birth.
compare
EssentialsDateTime
The date used for calculating the age.
Returns
The age based on the specified then
at the moment of
compare
.
GetAge(DateTimeOffset, EssentialsTime)
Gets the current age, from the specified then
. The age is calculated based on
compare
.
public static int GetAge(DateTimeOffset then, EssentialsTime compare)
Parameters
then
DateTimeOffset
The date of birth.
compare
EssentialsTime
The date used for calculating the age.
Returns
The age based on the specified then
at the moment of
compare
.
GetAge(EssentialsDate)
Returns the age as calculated between then
and the current date.
public static int GetAge(EssentialsDate then)
Parameters
then
EssentialsDate
The date of birth.
Returns
The age calculated between the current date and then
.
GetAge(EssentialsDate, DateTime)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsDate then, DateTime compare)
Returns
The calculated age between the two dates.
GetAge(EssentialsDate, DateTimeOffset)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsDate then, DateTimeOffset compare)
Parameters
then
EssentialsDate
The date of birth.
compare
DateTimeOffset
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsDate, EssentialsDate)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsDate then, EssentialsDate compare)
Parameters
then
EssentialsDate
The date of birth.
compare
EssentialsDate
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsDate, EssentialsDateTime)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsDate then, EssentialsDateTime compare)
Parameters
then
EssentialsDate
The date of birth.
compare
EssentialsDateTime
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsDate, EssentialsTime)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsDate then, EssentialsTime compare)
Parameters
then
EssentialsDate
The date of birth.
compare
EssentialsTime
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsDateTime)
Returns the age as calculated between then
and the current date.
public static int GetAge(EssentialsDateTime then)
Parameters
then
EssentialsDateTime
The date of birth.
Returns
The age calculated between the current date and then
.
GetAge(EssentialsDateTime, DateTime)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsDateTime then, DateTime compare)
Returns
The calculated age between the two dates.
GetAge(EssentialsDateTime, DateTimeOffset)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsDateTime then, DateTimeOffset compare)
Parameters
then
EssentialsDateTime
The date of birth.
compare
DateTimeOffset
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsDateTime, EssentialsDate)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsDateTime then, EssentialsDate compare)
Parameters
then
EssentialsDateTime
The date of birth.
compare
EssentialsDate
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsDateTime, EssentialsDateTime)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsDateTime then, EssentialsDateTime compare)
Parameters
then
EssentialsDateTime
The date of birth.
compare
EssentialsDateTime
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsDateTime, EssentialsTime)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsDateTime then, EssentialsTime compare)
Parameters
then
EssentialsDateTime
The date of birth.
compare
EssentialsTime
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsTime)
Returns the age as calculated between then
and the current date.
public static int GetAge(EssentialsTime then)
Parameters
then
EssentialsTime
The date of birth.
Returns
The age calculated between the current date and then
.
GetAge(EssentialsTime, DateTime)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsTime then, DateTime compare)
Returns
The calculated age between the two dates.
GetAge(EssentialsTime, DateTimeOffset)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsTime then, DateTimeOffset compare)
Parameters
then
EssentialsTime
The date of birth.
compare
DateTimeOffset
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsTime, EssentialsDate)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsTime then, EssentialsDate compare)
Parameters
then
EssentialsTime
The date of birth.
compare
EssentialsDate
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsTime, EssentialsDateTime)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsTime then, EssentialsDateTime compare)
Parameters
then
EssentialsTime
The date of birth.
compare
EssentialsDateTime
The date to compare against.
Returns
The calculated age between the two dates.
GetAge(EssentialsTime, EssentialsTime)
Returns the age as calculated between the two dates then
and compare
.
public static int GetAge(EssentialsTime then, EssentialsTime compare)
Parameters
then
EssentialsTime
The date of birth.
compare
EssentialsTime
The date to compare against.
Returns
The calculated age between the two dates.