Skip to content

Instantly share code, notes, and snippets.

@clifff
Created August 20, 2012 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifff/3406515 to your computer and use it in GitHub Desktop.
Save clifff/3406515 to your computer and use it in GitHub Desktop.
month plus ordinal date
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