11件ヒット
[1-11件を表示]
(0.111秒)
ライブラリ
- date (11)
検索結果
先頭1件
-
DateTime (44025.0)
-
日付だけでなく時刻も扱える Date のサブクラスです。
...刻も扱える Date のサブクラスです。
DateTime は deprecated とされているため、
Timeを使うことを推奨します。
=== 簡単なつかいかた
require 'date'
a = DateTime.new(1993, 2, 24, 12, 30, 45)
b = DateTime.parse('1993-02-24T12:30:45')
b += 10
b - a......#=> 10
b.year #=> 1993
b.strftime('%a') #=> "Sat"
yesterday = DateTime.now - 1...