Last active
April 12, 2017 19:13
-
-
Save Evanto/edc41067a9feefa7ca1a7c270568d0cb to your computer and use it in GitHub Desktop.
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
<p><%#= t = min %></p> | |
<p><%#= hour, t = t.divmod(60) %></p> | |
<p><%#= "%02d:%02d" % [hour, t] # => "18:30" %></p> |
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
<% @page = Page.last %> | |
<% t = @page.hours.to_i * 60 + @page.minutes.to_i %> | |
<% hour, t = t.divmod(60) %> | |
<%= "%02d:%02d" % [hour, t] %> |
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
<div class="row text-center"> | |
<% @page = Page.last %> | |
<p><%#= @page.hours.to_s + " : " + @page.minutes.to_s %></p> | |
<p><%= t = @page.hours.to_i * 60 + @page.minutes.to_i # => 1110 mins %></p> | |
<%= @page = Page.last %> | |
<%= @page.hours.to_s + " : " + @page.minutes.to_s %> | |
<p><%#= t = min %></p> | |
<p><%#= hour, t = t.divmod(60) %></p> | |
<p><%#= "%02d:%02d" % [hour, t] # => "18:30" %></p> | |
<p><%#= t = Time.at(1110) %></p> | |
<p><%#= t = Date.strptime("20150307", "%Y%m%d") %></p> | |
<p><%#= t = Date.strptime("1110", "%R") %></p> | |
<p><%#= t.hours %></p> | |
<p><%#= t = Time.new(2017, 08, 07, 18, 30, 00) %></p> | |
<p><%#= Time.at(t).strftime("%H:%M") %></p> | |
<p><%#= Time.at(t).strftime("%R") %></p> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment