Created
August 20, 2012 18:37
-
-
Save clifff/3406515 to your computer and use it in GitHub Desktop.
month plus ordinal date
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
def date_whatever(time,tz=false) | |
return "" if time.nil? | |
if time.kind_of? String | |
time = Time.parse(time) | |
end | |
tz = TzTime.zone unless tz | |
time = tz.utc_to_local(time.utc) | |
month = time.strftime("%B") | |
day = time.day.ordinalize | |
return month + " " + day | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment