Rubyで日付を取得する
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[Ruby]]
*内容 [#ved13244]
Rubyで日付を取得するにはdateライブラリを読み込んだ上でDat...
*記述 [#n6910903]
require 'date'
thisyear = Date.today
thismonth = Date.today
thisdate = Date.today ...
sd1 = thisyear.strftime("%Y")
sd2 = thismonth.strftime("%m")
sd3 = thisdate.strftime("%d")
print #{sd1}/#{sd2}/#{sd3}
終了行:
[[Ruby]]
*内容 [#ved13244]
Rubyで日付を取得するにはdateライブラリを読み込んだ上でDat...
*記述 [#n6910903]
require 'date'
thisyear = Date.today
thismonth = Date.today
thisdate = Date.today ...
sd1 = thisyear.strftime("%Y")
sd2 = thismonth.strftime("%m")
sd3 = thisdate.strftime("%d")
print #{sd1}/#{sd2}/#{sd3}
ページ名: