actionview/lib/action_view/helpers/date_helper.rb
# Returns an HTML time tag for the given date or time.
#
#   time_tag Date.today  # =>
#     <time datetime="2010-11-04">November 04, 2010</time>
#   time_tag Time.now  # =>
#     <time datetime="2010-11-04T17:55:45+01:00">November 04, 2010 17:55</time>
#   time_tag Date.yesterday, 'Yesterday'  # =>
#     <time datetime="2010-11-03">Yesterday</time>
#   time_tag Date.today, datetime: Date.today.strftime('%G-W%V') # =>
#     <time datetime="2010-W44">November 04, 2010</time>
#
#   <%= time_tag Time.now do %>
#     <span>Right now</span>
#   <% end %>
#   # => <time datetime="2010-11-04T17:55:45+01:00"><span>Right now</span></time>
Returns an HTML time tag for the given date or time.


Returns an HTML time tag for the given date or time .
def time_tag(date_or_time, *args, &block)
        options  = args.extract_options!
        format   = options.delete(:format) || :long
        content  = args.first || I18n.l(date_or_time, format: format)
        content_tag("time", content, options.reverse_merge(datetime: date_or_time.iso8601), &block)
      end
def time_tag ( date_or_time , * args , & block ) options = args . extract_options! format = options . delete ( :format ) || :long content = args . first || I18n . l ( date_or_time , format : format ) content_tag ( "time" , content , options . reverse_merge ( datetime : date_or_time . iso8601 ) , & block ) end
Returns an HTML time tag for the given date or time.
Returns an HTML time tag for the given date or time .
date_or_time
<not_specific>
args
<not_specific>
block
<not_specific>