169件ヒット
[1-100件を表示]
(0.109秒)
種類
- インスタンスメソッド (147)
- クラス (11)
- 定数 (11)
キーワード
- == (11)
-
RFC822
_ MONTHS (11) - Time (11)
-
backtrace
_ locations (11) - byteoffset (4)
- httpdate (11)
- mon (22)
- offset (22)
- rfc2822 (11)
- rfc822 (11)
- strftime (11)
-
to
_ a (11)
検索結果
先頭5件
-
Time
# month -> Integer (18207.0) -
月を整数で返します。
...月を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.month # => 1
p t.mon # => 1
//}... -
Date
# month -> Integer (15201.0) -
月を返します (1-12)。
月を返します (1-12)。 -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (9242.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...ception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if D......000, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `g......et_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
CGI
:: RFC822 _ MONTHS -> [String] (9200.0) -
822 で定義されている月名の略称を返します。
822 で定義されている月名の略称を返します。
@see 822 -
Time
# strftime(format) -> String (9130.0) -
時刻を format 文字列に従って文字列に変換した結果を返します。
...角空白で埋める ( 1..31)
* %F: %Y-%m-%d と同等 (ISO 8601の日付フォーマット)
* %G: ISO 8601の暦週の年
* %g: ISO 8601の暦週の年の下2桁(00-99)
* %H: 24時間制の時(00-23)
* %h: %b と同等
* %I: 12時間制の時(01-12)
* %j: 年中の通算日(001-366)......後(AM,PM)
* %Q: 1970-01-01 00:00:00 UTC からの経過ミリ秒 (Time#strftime は対応していませんが、Date#strftime で使えます)
* %R: 24時間制の時刻。%H:%M と同等。
* %r: 12時間制の時刻。%I:%M:%S %p と同等。
* %S: 秒(00-60) (60はうるう秒)
* %s:.......strftime("%Y%m%d") # => 20010203 Calendar date (basic)
p t.strftime("%F") # => 2001-02-03 Calendar date (extended)
p t.strftime("%Y-%m") # => 2001-02 Calendar date, reduced accuracy, specific month
p t.strftime("%Y... -
Time (6006.0)
-
時刻を表すクラスです。
...時刻を表すクラスです。
Time.now は現在の時刻を返します。
File.mtime などが返すファイルのタイムスタンプは Time
オブジェクトです。
Time オブジェクトは時刻を起算時からの経過秒数で保持しています。
起算時は協定世界......定するかどうかはシステムに
よります。
Time オブジェクトが格納可能な時刻の範囲は環境によって異なっていましたが、
Ruby 1.9.2 からは OS の制限の影響を受けません。
また、Time オブジェクトは協定世界時と地方時のど......ro-rubykaigi-02-akr-2009.pdf や
「APIデザインケーススタディ」(https://gihyo.jp/book/2016/978-4-7741-7802-8)
の第4章を参照してください。
localtime(3) も参照してください。
=== C 言語との違いに注意
C 言語の tm 構造体とは異なり、month は 1... -
Time
# mon -> Integer (3107.0) -
月を整数で返します。
...月を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.month # => 1
p t.mon # => 1
//}... -
Time
# httpdate -> String (3106.0) -
2616 で定義されている HTTP-date の rfc1123-date 形式の文字列を 返します。
...形式の文字列を返します。
//emlist{
day-of-week, DD month-name CCYY hh:mm:ss GMT
//}
注意: 結果はいつも UTC (GMT) です。
使用例
require 'time'
iso8601_time = '2008-08-31T12:34:56+09:00'
t = Time.iso8601(iso8601_time)
p t.httpdate #=> "Sun, 31 Aug 2008... -
Time
# rfc2822 -> String (3106.0) -
2822 で定義されている date-time として表現される形式の文字列を 返します。
...されている date-time として表現される形式の文字列を
返します。
@return 以下の形式の文字列を返します。
//emlist{
day-of-week, DD month-name CCYY hh:mm:ss zone
//}
ただし zone は [+-]hhmm です。
self が UTC time の場合、zone は +0......000 になります。
使用例
require 'time'
iso8601_time = '2008-08-31T12:34:56+09:00'
t = Time.iso8601(iso8601_time)
p t.rfc2822 #=> "Sun, 31 Aug 2008 03:34:56 -0000"... -
Time
# rfc822 -> String (3106.0) -
2822 で定義されている date-time として表現される形式の文字列を 返します。
...されている date-time として表現される形式の文字列を
返します。
@return 以下の形式の文字列を返します。
//emlist{
day-of-week, DD month-name CCYY hh:mm:ss zone
//}
ただし zone は [+-]hhmm です。
self が UTC time の場合、zone は +0......000 になります。
使用例
require 'time'
iso8601_time = '2008-08-31T12:34:56+09:00'
t = Time.iso8601(iso8601_time)
p t.rfc2822 #=> "Sun, 31 Aug 2008 03:34:56 -0000"...