るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
4件ヒット [1-4件を表示] (0.209秒)

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

Ripper#encoding -> Encoding (22.0)

自身の持つ Ruby プログラムの文字エンコーディングを返します。

自身の持つ Ruby プログラムの文字エンコーディングを返します。

Ruby プログラムの解析前は Encoding::US_ASCII を返します。

Time#asctime -> String (22.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 Ja...

Time#ctime -> String (22.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 Ja...

Time#to_s -> String (22.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 #...