るりまサーチ

最速Rubyリファレンスマニュアル検索!
120件ヒット [1-100件を表示] (0.035秒)
トップページ > クエリ:time[x] > クエリ:strptime[x]

別のキーワード

  1. time httpdate
  2. time rfc2822
  3. time iso8601
  4. time parse

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

Time.strptime(date, format, now=self.now) -> Time (41396.0)

文字列を Date._strptime を用いて Time オブジェクト に変換します。

...e._strptime を用いて Time オブジェクト
に変換します。

require 'time'
Time
.strptime('2001-02-03T04:05:06+09:00', '%Y-%m-%dT%H:%M:%S%z')
#=> 2001-02-03 06:05:06 +0900

ブロックを渡すと年の部分をブロックによって変換できます。
require 'time'
Time
.s...
...trptime('91/5/18 4:13:00', '%Y/%m/%d %T'){|y|
if y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
end
}
#=> 1991-05-18 04:13:00 +0900

Time
.strptime('01/5/18 4:13:00', '%Y/%m/%d %T'){|y|
if y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
end...
...}
#=> 2001-05-18 04:13:00 +0900

詳しくは DateTime.strptime, Date.strptime を見てください。

@param date 時刻を表す文字列
@param format 書式文字列...

Time.strptime(date, format, now=self.now) {|y| ... } -> Time (41396.0)

文字列を Date._strptime を用いて Time オブジェクト に変換します。

...e._strptime を用いて Time オブジェクト
に変換します。

require 'time'
Time
.strptime('2001-02-03T04:05:06+09:00', '%Y-%m-%dT%H:%M:%S%z')
#=> 2001-02-03 06:05:06 +0900

ブロックを渡すと年の部分をブロックによって変換できます。
require 'time'
Time
.s...
...trptime('91/5/18 4:13:00', '%Y/%m/%d %T'){|y|
if y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
end
}
#=> 1991-05-18 04:13:00 +0900

Time
.strptime('01/5/18 4:13:00', '%Y/%m/%d %T'){|y|
if y > 100 then y
elsif y >= 69 then y + 1900
else y + 2000
end...
...}
#=> 2001-05-18 04:13:00 +0900

詳しくは DateTime.strptime, Date.strptime を見てください。

@param date 時刻を表す文字列
@param format 書式文字列...

DateTime.strptime(str = &#39;-4712-01-01T00:00:00+00:00&#39;, format = &#39;%FT%T%z&#39;, start = Date::ITALY) -> DateTime (27325.0)

与えられた雛型で日時表現を解析し、 その情報に基づいて DateTime オブジェクトを生成します。

...与えられた雛型で日時表現を解析し、
その情報に基づいて DateTime オブジェクトを生成します。

@param str 日時をあらわす文字列
@param format 書式
@param start グレゴリオ暦をつかい始めた日をあらわすユリウス日
@raise ArgumentError...
...正しくない日時になる組み合わせである場合に発生します。

例:

require 'date'
DateTime.strptime('2001-02-03T12:13:14Z').to_s
# => "2001-02-03T12:13:14+00:00"

@see Date.strptime, DateTime._strptime, strptime(3), Date#strftime...

Date.strptime(str = &#39;-4712-01-01&#39;, format = &#39;%F&#39;, start = Date::ITALY) -> Date (24213.0)

与えられた雛型で日付表現を解析し、 その情報に基づいて日付オブジェクトを生成します。

...日付表現を解析し、
その情報に基づいて日付オブジェクトを生成します。

Date._strptime も参照してください。
また strptime(3)、および Date#strftime も参照してください。

@param str 日付をあらわす文字列
@param format 書式
@param start...

DateTime._strptime(str, format = &#39;%FT%T%z&#39;) -> Hash (15225.0)

与えられた雛型で日時表現を解析し、その情報に基づいてハッシュを生成します。

...す文字列
@param format 書式

例:

require 'date'
DateTime._strptime('2001-02-03T12:13:14Z')
# => {:year=>2001, :mon=>2, :mday=>3, :hour=>12, :min=>13, :sec=>14, :zone=>"Z", :offset=>0}

DateTime.strptime の内部で使用されています。

@see Date._strptime, DateTime.strptime...

絞り込み条件を変える

Date._strptime(str, format = &#39;%F&#39;) -> Hash (12217.0)

このメソッドは Date.strptime と似ていますが、日付オブジェクトを生成せずに、 見いだした要素をハッシュで返します。

...このメソッドは Date.strptime と似ていますが、日付オブジェクトを生成せずに、
見いだした要素をハッシュで返します。

@param str 日付をあらわす文字列
@param format 書式文字列

書式文字列に使用できるものは以下の通りです...

Date#strftime(format = &#39;%F&#39;) -> String (6106.0)

与えられた雛型で日付を書式づけます。

..., %I, %j, %k, %L, %l,
%M, %m, %N, %n, %P, %p, %Q, %R, %r, %S, %s, %T, %t, %U, %u, %V, %v, %W, %w, %X,
%x, %Y, %y, %Z, %z, %:z, %::z, %:::z, %%, %+

GNU 版にあるような幅指定などもできます。

strftime(3)、および Date.strptime も参照してください。

@param format 書式...

NEWS for Ruby 2.2.0 (66.0)

NEWS for Ruby 2.2.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...* Float
* 追加: Float#next_float
* 追加: Float#prev_float

* File
* 追加: File.birthtime
* 追加: File#birthtime

* File::Stat
* 追加: File::Stat#birthtime

* GC
* GC.latest_gc_info は現在のGCのステータスを再現するために :state を返す...
...追加: Vector.independent?, Vector#independent?

* pathname
* Pathname#/ は Pathname#+ のエイリアスです
* 追加: Pathname#birthtime

* rake
* Rake 10.4.0 になりました。
http://docs.seattlerb.org/rake/History_rdoc.html#label-10.4.0

* rubygems
* RubyGems...
...* time
* Time.parse, Time.strptime, Time.rfc2822, Time.xmlschema may produce
fixed-offset Time objects.
It is happen when usual localtime doesn't preserve the offset from UTC.
* Time.httpdate は常にUTCのTimeオブジェクトを生成します。
* Time.strptime...

ruby 1.9 feature (66.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...uby 2.0 ブロックローカル変数

((<URL:http://www.rubyist.net/~matz/20050309.html#p03>))

=== 2005-03-04

: Time.strptime [lib][new]
: ParseDate.strptime [lib][new]

time
ライブラリ, parsedate ライブラリに追加 ((<ruby-talk:132815>))

=== 2005-03-04

1.9.0 からメソッ...
...113069>))

=== 2004-09-26

: Time#to_time [lib][new]
: Time#to_date [lib][new]
: Time#to_datetime [lib][new]
: Date#to_time [lib][new]
: Date#to_date [lib][new]
: Date#to_datetime [lib][new]
: DateTime#to_time [lib][new]
: DateTime#to_date [lib][new]
: DateTime#to_datetime [lib][new]

追加 ((<ru...
...5

=== 2004-05-25
: allow passing a block to a Proc [ruby] [change]
((<ruby-dev:23533>)) ((-よくわからない-))

=== 2004-05-14

: Time [marshal]

Marshal.dump により、タイムゾーンの情報を保持するようになりました。

=== 2004-04-15

: Dir.glob [bug]...

Kernel.#format(format, *arg) -> String (18.0)

format 文字列を C 言語の sprintf と同じように解釈し、 引数をフォーマットした文字列を返します。

...ます。

@param format フォーマット文字列です。
@param arg フォーマットされる引数です。
@see Kernel.#printf,Time#strftime,Date.strptime

=== sprintf フォーマット

Ruby の sprintf フォーマットは基本的に C 言語の sprintf(3)
のものと同じです。...
...況によってフォーマットを変えたいが引数の順序を変えたくない場合に使
用します。
//emlist[][ruby]{
case ENV['LC_TIME']
when /^ja_JP/
fmt = "%1$d年%2$d月%3$d日"
else
fmt = "%2$02d/%03$2d/%1$02d"
end

p sprintf(fmt, 1, 4, 22) #=> "04/22/01"
//}
"*" の後に...

絞り込み条件を変える

<< 1 2 > >>