Issue #9521 has been updated by Yui NARUSE.


Marcus Stollsteimer wrote:
> @zak Just to consider: I used EST because
> 
> * the docs for `Time` state: _All of these examples were done using the EST timezone which is GMT-5._
> * AFAIK it's not easily possible to set JST on the local machine (via environment variable) so that these examples can be reproduced, since it's not part of RFC 822. Setting to EST works fine (even in Germany):
> 
>   2.1.1 :012 > ENV["TZ"] = "EST"
>   2.1.1 :013 > Time.parse("2014-01-01")
>    => 2014-01-01 00:00:00 -0500 
>   2.1.1 :014 > ENV["TZ"] = "JST"
>   2.1.1 :015 > Time.parse("2014-01-01")
>    => 2014-01-01 00:00:00 +0000

TZ environment variable must be used like

irb(main):001:0> require"time"
=> true
irb(main):002:0> ENV["TZ"]="EST+5"
=> "EST+5"
irb(main):003:0> Time.parse("2014-01-01")
=> 2014-01-01 00:00:00 -0500
irb(main):004:0> ENV["TZ"]="JST-9"
=> "JST-9"
irb(main):005:0> Time.parse("2014-01-01")
=> 2014-01-01 00:00:00 +0900

see also http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html

----------------------------------------
Bug #9521: [Doc] Fix error in Time.parse documentation (in lib/time)
https://bugs.ruby-lang.org/issues/9521#change-45839

* Author: Marcus Stollsteimer
* Status: Feedback
* Priority: Normal
* Assignee: Zachary Scott
* Category: doc
* Target version: 
* ruby -v: ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
The docs state that the examples are for GMT as local time zone while in fact they are for JST.
The patch fixes this by using EST (and saying so), like the rest of the examples for lib/time.


---Files--------------------------------
doc_lib_time.patch (1.13 KB)


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