Skip to content

Instantly share code, notes, and snippets.

@carlosbrando
Created December 12, 2015 17:16
Show Gist options
  • Save carlosbrando/d751d78ea993e8a633d6 to your computer and use it in GitHub Desktop.
Save carlosbrando/d751d78ea993e8a633d6 to your computer and use it in GitHub Desktop.
public static class Extensions {
public static int Megabytes(this int value) {
return value * 1024 * 1024;
}
public static int Kilobytes(this int value) {
return value * 1024;
}
public static int Days(this int value) {
return value * 24 * 60 * 60 * 1000;
}
public static DateTime Ago(this int value) {
return DateTime.Now.AddMilliseconds(-value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment