Project

General

Profile

Actions

Bug #786

closed

Time#strftime で %s が負である場合に桁を間違える

Added by tadf (tadayoshi funaba) over 15 years ago. Updated about 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
Backport:

Description

=begin
$ ./ruby -e "p Time.at(-1).strftime('[%03s]')"
"[-001]"

ちなみにうちの環境だと glibc がボロボロのよう。

$ ruby18 -e "p Time.at(-1).strftime('[%05s]')"
"[000-1]"

$ ruby18 -e "p Time.at(-1).strftime('[%05z]')"
"[0000+00900]"

なお、%s が桁を補う場合のデフォルトが 0 なのか空白なのかは、うちで
は glibc と gnu date で異なっているようです。DateTime では、0 を補
うことにしています。
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0