LoginSignup
4
4

More than 5 years have passed since last update.

Middlemanで最終更新日時を出力する

Posted at

Rubyで最新の日時を出力するRubyのコードを書きます。

下記はSlimでの例です。 DateTime.now で現在時刻が取得できるので、そのままHTMLに出力されます。

small
  = "Last Modified: #{DateTime.now}"

もちろん、erbでもできます。

<small>Last Modified: <%= DateTime.now %></small>

これにより Last Modified: 2014-07-23T22:33:41+09:00 のような文字が出力できます。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4