Skip to content

Instantly share code, notes, and snippets.

@slpsys
Created April 29, 2011 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slpsys/948702 to your computer and use it in GitHub Desktop.
Save slpsys/948702 to your computer and use it in GitHub Desktop.
public static DateTime today = DateTime.Today,
yesterday = today.AddDays(-1),
twoDaysAgo = yesterday.AddDays(-1),
threeDaysAgo = twoDaysAgo.AddDays(-1),
tomorrow = today.AddDays(1),
dayAfterTomorrow = tomorrow.AddDays(1),
twoDaysAfterTomorrow = dayAfterTomorrow.AddDays(1),
friday = today.AddDays((5 + 7 - (int)today.DayOfWeek) % 7), // http://www.imdb.com/title/tt0113118/
nextFriday = friday.AddDays(7), // http://www.imdb.com/title/tt0195945/
fridayAfterNext = friday.AddDays(7); // http://www.imdb.com/title/tt0293815/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment