DateTime EndOfMonth extension method

This method returns the end of the passed month at midnight - very useful for SQL date ranges

Public Function EndOfMonth(Extends Value As DateTime) As DateTime
  Var Result As New DateTime(Value.Year, Value.Month, 1) ' First day of Value month
  Result = Result.AddInterval(0, 1) ' Midnight on the last day of the month or 12am on the first of next month
  Return Result
End Function