Created
February 9, 2010 15:25
-
-
Save leandro/299308 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # this should exist natively | |
| # extending strftime for syntatic sugar sake | |
| class Time | |
| def % str | |
| strftime(str) | |
| end | |
| end | |
| # usage | |
| Time.new % "%Y" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment