Created
December 12, 2015 17:16
-
-
Save carlosbrando/d751d78ea993e8a633d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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