[edit] 要約 組み込みの Time クラスを拡張します。日時を表す文字列をパースして Time オブジェクトに変換したり、逆に Time オブジェクトを RFC などで定められた文字列に変換する機能を提供します。 date-time は [RFC2822] で定義されています。 HTTP-date は [RFC2616] で定義されています。 dateTime は XML Schema Part 2: Datatypes (ISO 8601) で定義されています。 文字列から Time オブジェクトへの変換では Date._parse により様々な形式を扱えます。 追加・再定義されるメソッド Time#httpdate Time#iso8601 Time#rfc2822 Time#rfc822 Time#xmlschema Time.httpdate Time.iso8601 Tim
class Time time.rb¶ ↑ When 'time' is required, Time is extended with additional methods for parsing and converting Times. Features¶ ↑ This library extends the Time class with the following conversions between date strings and Time objects: date-time defined by RFC 2822 HTTP-date defined by RFC 2616 dateTime defined by XML Schema Part 2: Datatypes (ISO 8601) various formats handled by Date._parse c
strftime(format) -> String[permalink][rdoc][edit] 時刻を format 文字列に従って文字列に変換した結果を返します。 [PARAM] format: フォーマット文字列を指定します。使用できるものは 以下の通りです。 %A: 曜日の名称(Sunday, Monday ... ) %a: 曜日の省略名(Sun, Mon ... ) %B: 月の名称(January, February ... ) %b: 月の省略名(Jan, Feb ... ) %C: 世紀 (2009年であれば 20) %c: 日付と時刻 (%a %b %e %T %Y) %D: 日付 (%m/%d/%y) %d: 日(01-31) %e: 日。一桁の場合、半角空白で埋める ( 1..31) %F: %Y-%m-%d と同等 (ISO 8601の日付フォーマット) %G:
[edit] 要約 時刻を表すクラスです。 Time.now は現在の時刻を返します。 File.mtime などが返すファイルのタイムスタンプは Time オブジェクトです。 Time オブジェクトは時刻を起算時からの経過秒数で保持しています。起算時は協定世界時(UTC、もしくはその旧称から GMT とも表記されます) の 1970年1月1日午前0時です。なお、うるう秒を勘定するかどうかはシステムによります。 Time オブジェクトが格納可能な時刻の範囲は環境によって異なっていましたが、 Ruby 1.9.2 からは OS の制限の影響を受けません。 また、Time オブジェクトは協定世界時と地方時のどちらのタイムゾーンを使用するかのフラグを内部に保持しています。タイムゾーンのフラグは Marshal データに保持されます。 p Marshal.load(Marshal.dump(Tim
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く