るりまサーチ

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

別のキーワード

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

ライブラリ

検索結果

Rake::FileTask#timestamp -> Time | Rake::LateTime (24409.0)

ファイルタスクのタイムスタンプを返します。

...ファイルタスクのタイムスタンプを返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: "test.txt"
file "test.txt" do |task|
Rake.application.options.build_all = false
task.timestamp # => #<Rake::LateTime:0x2ba58f0>
end
//}...

Socket::AncillaryData#timestamp -> Time (24355.0)

タイムスタンプ制御メッセージに含まれる時刻を Time オブジェクト で返します。

...に含まれる時刻を Time オブジェクト
で返します。

"タイムスタンプ制御メッセージ" は以下のいずれかです。
* SOL_SOCKET/SCM_TIMESTAMP (micro second) GNU/Linux, FreeBSD, NetBSD, OpenBSD, Solaris, MacOS X
* SOL_SOCKET/SCM_TIMESTAMPNS (nano second) GNU/Lin...
...ux
* SOL_SOCKET/SCM_BINTIME (2**(-64) second) FreeBSD

require 'socket'

Addrinfo.udp("127.0.0.1", 0).bind {|s1|
Addrinfo.udp("127.0.0.1", 0).bind {|s2|
s1.setsockopt(:SOCKET, :TIMESTAMP, true)
s2.send "a", 0, s1.local_address
ctl = s1.recvmsg.last
p ctl...
...SOCKET TIMESTAMP 2009-02-24 17:35:46.775581>
t = ctl.timestamp
p t #=> 2009-02-24 17:35:46 +0900
p t.usec #=> 775581
p t.nsec #=> 775581000
}
}

@see Socket::Constants::SCM_TIMESTAMP,
Socket::Constants::SCM_TIMESTAMPNS,
Socket::Constants::SCM_BINTIME,...

Rake::FileCreationTask#timestamp -> Rake::EarlyTime (24308.0)

どんなタイムスタンプよりも前の時刻をあらわすタイムスタンプを返します。

...どんなタイムスタンプよりも前の時刻をあらわすタイムスタンプを返します。


@see [[FileTask#timestamp]]...

Rake::Task#timestamp -> Time (24303.0)

自身のタイムスタンプを返します。

自身のタイムスタンプを返します。

基本的なタスクは現在時刻を返しますが、高度なタスクはタイムスタンプを
計算して返します。

Logger#formatter -> String (31.0)

ログを出力する際に使用するフォーマッターを取得します。

..., time, program name, message) を受けとります。

//emlist[例][ruby]{
require 'logger'

logger = Logger.new(STDOUT)
logger.formatter # => nil
logger.info("test")
# => I, [2019-05-09T22:13:56.509159 #13912] INFO -- : test

ltsv_formatter = proc { |severity, timestamp, progname, msg|
"time:...
...#{timestamp}\tlevel:#{severity}\tprogname:#{progname}\tmessage:#{msg}\n"
}
logger.formatter = ltsv_formatter
logger.formatter # => #<Proc:0x00007fa3048b8e00@/path/to/file:8>
logger.info("MyApp") { "test" }

# => time:2019-05-09 22:13:56 +0900 level:INFO progname:MyApp message:test
//}...

絞り込み条件を変える