ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:82369] [Ruby trunk Misc#13810] Inconsistency between Date and Time.strftime("%v")
       [not found] <redmine.issue-13810.20170813144830@ruby-lang.org>
@ 2017-08-13 14:48 ` steele
  2017-08-14  0:20 ` [ruby-core:82372] [Ruby trunk Misc#13810][Feedback] " nobu
  2017-08-14 17:30 ` [ruby-core:82378] [Ruby trunk Misc#13810] " steele
  2 siblings, 0 replies; 3+ messages in thread
From: steele @ 2017-08-13 14:48 UTC (permalink / raw
  To: ruby-core

Issue #13810 has been reported by osteele (Oliver Steele).

----------------------------------------
Misc #13810: Inconsistency between Date and Time.strftime("%v")
https://bugs.ruby-lang.org/issues/13810

* Author: osteele (Oliver Steele)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
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
```




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:82372] [Ruby trunk Misc#13810][Feedback] Inconsistency between Date and Time.strftime("%v")
       [not found] <redmine.issue-13810.20170813144830@ruby-lang.org>
  2017-08-13 14:48 ` [ruby-core:82369] [Ruby trunk Misc#13810] Inconsistency between Date and Time.strftime("%v") steele
@ 2017-08-14  0:20 ` nobu
  2017-08-14 17:30 ` [ruby-core:82378] [Ruby trunk Misc#13810] " steele
  2 siblings, 0 replies; 3+ messages in thread
From: nobu @ 2017-08-14  0:20 UTC (permalink / raw
  To: ruby-core

Issue #13810 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Open to Feedback

At r31672, date changed it but no description or rationale.

> * ext/date/date_strftime(date_strftime_with_tmx): "%v" means "%e-%b-%Y".

Does anybody have any pointers?

----------------------------------------
Misc #13810: Inconsistency between Date and Time.strftime("%v")
https://bugs.ruby-lang.org/issues/13810#change-66167

* Author: osteele (Oliver Steele)
* Status: Feedback
* Priority: Normal
* Assignee: 
----------------------------------------
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
```




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:82378] [Ruby trunk Misc#13810] Inconsistency between Date and Time.strftime("%v")
       [not found] <redmine.issue-13810.20170813144830@ruby-lang.org>
  2017-08-13 14:48 ` [ruby-core:82369] [Ruby trunk Misc#13810] Inconsistency between Date and Time.strftime("%v") steele
  2017-08-14  0:20 ` [ruby-core:82372] [Ruby trunk Misc#13810][Feedback] " nobu
@ 2017-08-14 17:30 ` steele
  2 siblings, 0 replies; 3+ messages in thread
From: steele @ 2017-08-14 17:30 UTC (permalink / raw
  To: ruby-core

Issue #13810 has been updated by osteele (Oliver Steele).


Ruby's `Time.strftime` method (where `%v` is equivalent to `%e-%^b-%4Y`) is compatible with VMS time format, and `Date.strftime` and `DateTime.strftime` (where it is equivalent to `%e-%b-%Y`) are not, according to section 27.1.1 Absolute Time Format of ["OpenVMS Programming Concepts Manual"](https://www.itec.suny.edu/scsys/vms/ovmsdoc073/v73/5841/5841pro_072.html#111_thesystemtimeformat):

> The operating system uses the following format for absolute time. […]

`dd-MMM-yyyy hh:mm:ss.cc`
 
[…]

`MMM	Month (first 3 characters of the month in uppercase)`


----------------------------------------
Misc #13810: Inconsistency between Date and Time.strftime("%v")
https://bugs.ruby-lang.org/issues/13810#change-66176

* Author: osteele (Oliver Steele)
* Status: Feedback
* Priority: Normal
* Assignee: 
----------------------------------------
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
```




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-14 17:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-13810.20170813144830@ruby-lang.org>
2017-08-13 14:48 ` [ruby-core:82369] [Ruby trunk Misc#13810] Inconsistency between Date and Time.strftime("%v") steele
2017-08-14  0:20 ` [ruby-core:82372] [Ruby trunk Misc#13810][Feedback] " nobu
2017-08-14 17:30 ` [ruby-core:82378] [Ruby trunk Misc#13810] " steele

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).