Project

General

Profile

Actions

Bug #13810

closed

Inconsistency between Date and Time.strftime("%v")

Added by osteele (Oliver Steele) over 7 years ago. Updated about 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:82369]

Description

This seems odd. Each function matches its documentation, but the document and implementation of Date.strftime("%v") differs from the documentation and implementations of Time.strftime("%v") and DateTime.strftime("%v").

ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
require 'time'

# https://ruby-doc.org/stdlib-2.4.1/libdoc/date/rdoc/Date.html#method-i-strftime
# %v - VMS date (%e-%b-%Y)
d = Date.iso8601 "2006-01-02T15:04:05-05:00"
puts d.strftime("%v")           # -> 2-Jan-2006
puts d.strftime("%e-%b-%Y")     # -> 2-Jan-2006

# https://ruby-doc.org/stdlib-2.4.1/libdoc/date/rdoc/DateTime.html#method-i-strftime
# %v - VMS date (%e-%b-%Y)
dt = DateTime.iso8601 "2006-01-02T15:04:05-05:00"
puts dt.strftime("%v")          # -> 2-Jan-2006
puts dt.strftime("%e-%b-%Y")    # -> 2-Jan-2006

# https://ruby-doc.org/core-2.4.1/Time.html#method-i-strftime
# %v - VMS date (%e-%^b-%4Y)
t = Time.iso8601 "2006-01-02T15:04:05-05:00"
puts t.strftime("%v")           # 2-JAN-2006
puts t.strftime("%e-%^b-%4Y")   # 2-JAN-2006

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #4662: Date#strftime %v gives allcaps instead of normal capsClosedtadf (tadayoshi funaba)05/10/2011Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0