Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Extensions.DateTimeExtensions Class Reference

Any DateTime extension methods More...

Static Public Member Functions

static bool IsEqual (this DateTime val1, DateTime val2, bool checkDateComponent=true, bool checkTimeComponent=false)
 Determines if 2 DateTimes are "equal" More...
 
static bool IsLessThan (this DateTime val1, DateTime val2, bool checkDateComponent=true, bool checkTimeComponent=false)
 Determines if a Datetime occurred before another More...
 
static bool IsLessThanOrEqual (this DateTime val1, DateTime val2, bool checkDateComponent=true, bool checkTimeComponent=false)
 Determines if a Datetime occurred before or at the same time as another More...
 
static bool IsMoreThan (this DateTime val1, DateTime val2, bool checkDateComponent=true, bool checkTimeComponent=false)
 Determines if a Datetime occurred after another More...
 
static bool IsMoreThanOrEqual (this DateTime val1, DateTime val2, bool checkDateComponent=true, bool checkTimeComponent=false)
 Determines if a Datetime occurred after or at the same time as another More...
 
static bool Between (this DateTime val, DateTime val1, DateTime val2, bool checkDateComponent=true, bool checkTimeComponent=false, bool includeLowerValue=true, bool includeUpperValue=true)
 Determines if a Datetime occurred in a date range More...
 
static DateTime AsUtc (this DateTime val)
 If the value is UTC, this formally makes it UTC More...
 

Detailed Description

Any DateTime extension methods

Member Function Documentation

◆ AsUtc()

static DateTime Sphyrnidae.Common.Extensions.DateTimeExtensions.AsUtc ( this DateTime  val)
static

If the value is UTC, this formally makes it UTC

Parameters
valThe datetime value that was set via a UTC string
Returns
A UTC DateTime

◆ Between()

static bool Sphyrnidae.Common.Extensions.DateTimeExtensions.Between ( this DateTime  val,
DateTime  val1,
DateTime  val2,
bool  checkDateComponent = true,
bool  checkTimeComponent = false,
bool  includeLowerValue = true,
bool  includeUpperValue = true 
)
static

Determines if a Datetime occurred in a date range

Parameters
valThe datetime for comparison
val1The lower Datetime to compare
val2The upper Datetime to compare
checkDateComponentIf comparison will check the date component
checkTimeComponentIf comparison will check the time component
includeLowerValueSpecifies whether the check will include a value equal to val1 (lower)
includeUpperValueSpecifies whether the check will include a value equal to val2 (upper)
Returns
True if val falls between val1 and val2. False otherwise

◆ IsEqual()

static bool Sphyrnidae.Common.Extensions.DateTimeExtensions.IsEqual ( this DateTime  val1,
DateTime  val2,
bool  checkDateComponent = true,
bool  checkTimeComponent = false 
)
static

Determines if 2 DateTimes are "equal"

Parameters
val1The first Datetime to compare
val2The 2nd Datetime to compare
checkDateComponentIf comparison will check the date component
checkTimeComponentIf comparison will check the time component
Returns
True if equal, false otherwise

◆ IsLessThan()

static bool Sphyrnidae.Common.Extensions.DateTimeExtensions.IsLessThan ( this DateTime  val1,
DateTime  val2,
bool  checkDateComponent = true,
bool  checkTimeComponent = false 
)
static

Determines if a Datetime occurred before another

Parameters
val1The first Datetime to compare
val2The 2nd Datetime to compare
checkDateComponentIf comparison will check the date component
checkTimeComponentIf comparison will check the time component
Returns
True if first is less than the 2nd, false otherwise

◆ IsLessThanOrEqual()

static bool Sphyrnidae.Common.Extensions.DateTimeExtensions.IsLessThanOrEqual ( this DateTime  val1,
DateTime  val2,
bool  checkDateComponent = true,
bool  checkTimeComponent = false 
)
static

Determines if a Datetime occurred before or at the same time as another

Parameters
val1The first Datetime to compare
val2The 2nd Datetime to compare
checkDateComponentIf comparison will check the date component
checkTimeComponentIf comparison will check the time component
Returns
True if first is before or equal to the 2nd, false otherwise

◆ IsMoreThan()

static bool Sphyrnidae.Common.Extensions.DateTimeExtensions.IsMoreThan ( this DateTime  val1,
DateTime  val2,
bool  checkDateComponent = true,
bool  checkTimeComponent = false 
)
static

Determines if a Datetime occurred after another

Parameters
val1The first Datetime to compare
val2The 2nd Datetime to compare
checkDateComponentIf comparison will check the date component
checkTimeComponentIf comparison will check the time component
Returns
True if first is after than the 2nd, false otherwise

◆ IsMoreThanOrEqual()

static bool Sphyrnidae.Common.Extensions.DateTimeExtensions.IsMoreThanOrEqual ( this DateTime  val1,
DateTime  val2,
bool  checkDateComponent = true,
bool  checkTimeComponent = false 
)
static

Determines if a Datetime occurred after or at the same time as another

Parameters
val1The first Datetime to compare
val2The 2nd Datetime to compare
checkDateComponentIf comparison will check the date component
checkTimeComponentIf comparison will check the time component
Returns
True if first is after or equal to the 2nd, false otherwise

The documentation for this class was generated from the following file: