るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.134秒)
トップページ > クラス:Time[x] > バージョン:2.3.0[x] > 種類:インスタンスメソッド[x] > クエリ:Encoding::US_ASCII[x]

別のキーワード

  1. new openssl::bn
  2. new openssl::asn1::asn1data
  3. new openssl::pkey::ec::group
  4. new openssl::x509::certificate
  5. start net::smtp

ライブラリ

キーワード

検索結果

Time#asctime -> String (25.0)

時刻を asctime(3) の形式の文字列に変換します。た だし、末尾の改行文字 "\n" は含まれません。

...を asctime(3) の形式の文字列に変換します。た
だし、末尾の改行文字 "\n" は含まれません。

戻り値の文字エンコーディングは Encoding::US_ASCII です。

//emlist[][ruby]{
p Time.local(2000).asctime # => "Sat Jan 1 00:00:00 2000"
p Time.local(...
...2000).asctime.encoding # => #<Encoding:US-ASCII>
p Time.local(2000).ctime # => "Sat Jan 1 00:00:00 2000"
//}...

Time#ctime -> String (25.0)

時刻を asctime(3) の形式の文字列に変換します。た だし、末尾の改行文字 "\n" は含まれません。

...を asctime(3) の形式の文字列に変換します。た
だし、末尾の改行文字 "\n" は含まれません。

戻り値の文字エンコーディングは Encoding::US_ASCII です。

//emlist[][ruby]{
p Time.local(2000).asctime # => "Sat Jan 1 00:00:00 2000"
p Time.local(...
...2000).asctime.encoding # => #<Encoding:US-ASCII>
p Time.local(2000).ctime # => "Sat Jan 1 00:00:00 2000"
//}...

Time#to_s -> String (25.0)

時刻を文字列に変換した結果を返します。 以下のようにフォーマット文字列を使って strftime を呼び出すのと同じです。

...下のようにフォーマット文字列を使って strftime を呼び出すのと同じです。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p t.to_s # => "2000-01-02 03:04:05 +0900"
p t.strftime("%Y-%m-%d %H:%M:%S %z") # => "2000-01-02 03:04:05 +0900"

p...
...t.utc.to_s # => "2000-01-01 18:04:05 UTC"
p t.strftime("%Y-%m-%d %H:%M:%S UTC") # => "2000-01-01 18:04:05 UTC"
//}

戻り値の文字エンコーディングは Encoding::US_ASCII です。...