Project

General

Profile

Actions

Bug #9951

closed

DateTime.strftime and Time.strftime differ in how they treat "%L"

Added by dchelimsky (David Chelimsky) almost 10 years ago. Updated almost 10 years ago.

Status:
Rejected
Target version:
-
ruby -v:
1.9.3 - 2.1.1
[ruby-core:63211]

Description

DateTime.new(2014,1,2,3,4,5.678).strftime("%L")
# => "678"
Time.new(2014,1,2,3,4,5.678).strftime("%L")
# => "677"

I think these should both produce "678", but at the very least they should produce the same number so users don't have to special case one or the other. I realize there is floating point math under the hood here, but that's an implementation detail I don't think users should care about in this case.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0