Skip to content

Instantly share code, notes, and snippets.

@greenygh0st
Created April 23, 2016 14:42
Show Gist options
  • Save greenygh0st/30e40704aed2cc65ed8aa76de5426309 to your computer and use it in GitHub Desktop.
Save greenygh0st/30e40704aed2cc65ed8aa76de5426309 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Generic.Helpers
{
public static class DateTimerGreaterThan
{
/// <summary>
/// Is the first date greater than the second date?
/// </summary>
/// <param name="md"></param>
/// <param name="d1"></param>
/// <param name="d2"></param>
/// <returns>Bool</returns>
public static bool GreaterThan (this DateTime md, DateTime d1)
{
var r = DateTime.Compare(md, d1);
if (r == 1)
{
return true;
}
else
{
return false;
}
}
public static bool GreaterThan(this DateTime? md, DateTime d1)
{
var r = DateTime.Compare((DateTime)md, d1);
if (r == 1)
{
return true;
}
else
{
return false;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment