DateHelperExtension extension

Extensions on DateTime.

  • dayOfYear()
  • daysInMonth()
  • isBetween()
  • isInLeapYear()
  • isOnSameDayAs()
  • julianDay()
  • weekOfYear()
on

Methods

dayOfYear() int
Returns the number of days in this year e.g.: February 1st = 32.
daysInMonth() int
Returns the number of days in the month.
isBetween(DateTime lower, DateTime upper) bool
Returns true if this DateTime value is not older than lower (or lower=null) and not younger than upper (or upper=null).
isInLeapYear() bool
Returns true if this DateTime object is in a leap year with 366 days.
isOnSameDayAs(DateTime another) bool
Returns true if this DateTime object is on the same day as another.
julianDay() int
Computes the Julian day which is the number of days since Monday, January 1, 4713 BC.
weekOfYear() int
Week number in year. Week 1 has the first Thursday.