Created
November 16, 2011 17:05
-
-
Save jferris/1370669 to your computer and use it in GitHub Desktop.
Figure out what strtime characters are supported by your Ruby
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'active_support/core_ext' | |
chars = (('a'..'z').to_a + ('A'..'Z').to_a) | |
time = Time.now.beginning_of_month | |
twelve_hours_from_now = 12.hours.from_now | |
end_of_next_month = 1.month.from_now.end_of_month | |
chars.each do |char| | |
printf("%-8s %-25s %-25s %-25s\n", | |
char, | |
time.strftime("%#{char}").rstrip, | |
twelve_hours_from_now.strftime("%#{char}").rstrip, | |
end_of_next_month.strftime("%#{char}").rstrip) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment