Created
August 26, 2012 06:29
-
-
Save kisielk/3475026 to your computer and use it in GitHub Desktop.
My god what have I done...
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
var units = map[string]int{ | |
"s": 1, | |
"sec": 1, | |
"secs": 1, | |
"second": 1, | |
"seconds": 1, | |
"m": 60, | |
"min": 60, | |
"mins": 60, | |
"minute": 60, | |
"minutes": 60, | |
"h": 60 * 60, | |
"hr": 60 * 60, | |
"hrs": 60 * 60, | |
"hour": 60 * 60, | |
"hours": 60 * 60, | |
"d": 60 * 60 * 24, | |
"day": 60 * 60 * 24, | |
"days": 60 * 60 * 24, | |
"w": 60 * 60 * 24 * 7, | |
"week": 60 * 60 * 24 * 7, | |
"weeks": 60 * 60 * 24 * 7, | |
"M": 60 * 60 * 24 * 30, | |
"month": 60 * 60 * 24 * 30, | |
"months": 60 * 60 * 24 * 30, | |
"Y": 60 * 60 * 24 * 365, | |
"year": 60 * 60 * 24 * 365, | |
"years": 60 * 60 * 24 * 365, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment